tuo-ui2-single-file-uploader
v1.0.4
Published
## 修改package.json
Downloads
3
Readme
安装
修改package.json
{
"dependencies": {
"@tuo-ui/single-file-uploader": "git+ssh://[email protected]/t2904/single-file-uploader.git",
}
}
安装依赖包
npm install -S @tuo-ui/single-file-uploader
使用
import React, { useCallback, useState } from 'react'
import SingleFileUploader from '@tuo-ui/single-file-uploader'
const style ={
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
height: '100vh',
width: '100vw'
}
const App = () => {
const [file, setFile] = useState(null)
const onChange = useCallback((file) => {
setFile(file)
}, [])
return (
<div style={style}>
<div>
<SingleFileUploader
onChange={onChange}
/>
</div>
</div>
)
}
export default App;