excel-react-hooks
v1.0.8
Published
```javascript //hooks使用示例 /** * @description useReader,excel读取 * */ import { useReader } from "excel-react-hooks"; const { reader, data } = useReader( ["name", "age", "gender", "phone"], () => { console.log("success"); }, () => {
Downloads
4
Readme
//hooks使用示例
/**
* @description useReader,excel读取
* */
import { useReader } from "excel-react-hooks";
const { reader, data } = useReader(
["name", "age", "gender", "phone"],
() => {
console.log("success");
},
() => {
console.log("error");
}
);
<input type="file"
onChange={(e)=>{
reader.readAsArrayBuffer(e.target.files[0])
}}
/>
useEffect(()=>{
console.log(data)
},[data])