lr-file-preview
v1.0.6-alpha.5
Published
docx, pdf, xlsx, jpg, jpeg, png 集成预览工具
Maintainers
Readme
lr-file-preview
基于Web的文件预览解决方案,支持 docx, pdf, xlsx, jpg, jpeg, png, .txt 等格式的在线预览。
安装
npm install lr-file-preview --save引入
import { filePreview } from 'lr-file-preview'
const uploadPreview = new filePreview(file);
// 带弹窗标题
const uploadPreview = new filePreview(file, { title: "xx预览" });
属性
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | :--- | :--- | :--- | :--- | :--- | | file | 文件对象 | Object | - | - | | options | 样式 | Object | - | - |
options属性
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | :--- | :--- | :--- | :--- | :--- | | title | 标题 | String | - | '文件预览' | | container | 容器id | String | - | 'lr-file-preview' | | errorMsg | 错误提示 | String | - | '预览文件错误,请重新选择。' | | loadingMsg | 加载中提示 | String | - | '加载中,请稍后...' |
