0.1.23 • Published 5 months ago
@x-edu/attachments v0.1.23
x-edu/attachments
参数: {Object} options
参数 | 参数类型 | 是否必填 | 参数说明 | 默认值 |
---|---|---|---|---|
attachmentPreviewEnable | number | 是 | 是否开启预览 | 1 |
sdpAppId | string | 是 | sdpAppId | |
env | string | 是 | 环境 | preproduction |
uc | uc | 是 | uc | |
userInfo | object | 是 | 用户信息 | {} |
getCSToken | () => { } | 是 | geToken | '' |
attachmentUploadPath | string | 是 | 文件上传路径 | '' |
containerClassName | string | 否 | 容器classNanme | |
editable | boolean | 否 | 是否开启上传 | false |
description | string | 否 | 描述 | 添加图片、视频、音频、文件等附件 |
extraProps | object | 否 | 上传按钮前面的扩展 | |
fileSizeLimit | number | 否 | 大小限制 | 10 1024 1024 |
attachmentMaxCount | number | 否 | 上传数量限制 | 8 |
btnName | string | 否 | 上传按钮名称 | 添加附件 |
fileDatas | [] | 否 | 文件预览列表 | [] |
filePreview | () => { } | 否 | 自定义文件预览 | |
fileDownload | () => { } | 否 | 自定义文件下载 | |
uploadFileType | array | 否 | 文件上传类型 | [] |
VerifyCodePhone 文件上传
const uc = new UC({
...
})
export default function Demo() {
const [userInfo, setUserInfo] = useState(null)
const getCSToken = () => {}
useEffect(() => {
async function init() {
try {
await uc.login({
...
})
const info = await uc.getInfo() // 伪代码
setUserInfo(info)
} catch (error) {
console.log(error)
}
}
init()
}, [])
if (!userInfo) {
return null
}
return (
<Attachments
fileDatas={data}
editable={false}
uc={uc}
getCSToken={getCSToken}
userInfo={userInfo}
imgOnlyPreview={true}
attachmentUploadPath="/xxxx/xxx"
env="preproduction"
attachmentPreviewEnable="1"
/>
)
}
0.1.21
5 months ago
0.1.22
5 months ago
0.1.23
5 months ago
0.1.20
9 months ago
0.1.19
9 months ago
0.1.18
9 months ago
0.1.11
11 months ago
0.1.12
10 months ago
0.1.13
10 months ago
0.1.14
10 months ago
0.1.15
10 months ago
0.1.16
10 months ago
0.1.17
10 months ago
0.1.10
11 months ago
0.1.8
11 months ago
0.1.7
11 months ago
0.1.9
11 months ago
0.1.6
11 months ago
0.1.5
11 months ago
0.1.0
11 months ago
0.1.2
11 months ago
0.1.1
11 months ago
0.0.9
11 months ago
0.0.8
11 months ago
0.1.4
11 months ago
0.0.6
11 months ago
0.0.5
11 months ago
0.0.4
11 months ago
0.0.3
11 months ago
0.0.2
11 months ago
0.0.1
11 months ago