@fktest/vue-file-preview

1.0.1 • Public • Published

vue-file-preview

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

node:14.17.5

packages:存放你所需要开发的所有组件的目录 lib:存放组件源码 packages/index.js:将组件注册为全局组件 examples:最初项目的src,我们可以一边开发一边调试

仓库:https://packages.aliyun.com/npm/npm-registry/guide

使用: main.js中引入组件 import filePreview from 'vue-file-preview'; import 'vue-file-preview/lib/file-preview.css'; Vue.use(filePreview, 'name') // name为组件名称

    <file-preview extName="html" 
    :requestData="{
        schoolNum:15182,
        fileId:45317,
        randomDataId:'',
        token:'IrM6PSXZ/CKFgu2MWL3DqQ==',
        resName:'html',
        businessType:0,
        utId:''
        }"></file-preview>
extName: {
    type: String,
    default: 'pptx'
},
// 基础请求地址
baseUrl: {
    type: String,
    default: ''
},
// 请求接口地址
apiUrl: {
    type: String,
    default: ''
},
// 是否远程请求文件,默认是true
remote: {
    type: Boolean,
    default: true
},
// 文件请求参数
requestData: {
    type: Object,
    default () {
    return {
        schoolNum: '15182',
        fileId: '45320',
        randomDataId: '',
        token: 'IrM6PSXZ/CKFgu2MWL3DqQ==',
        resName: 'pptx',
        businessType: '0',
        utId: ''
    }
    }
},
// 预览数据
previewData: {
    type: Object,
    default () {
    return {}
    }
}

// 预览3d地址
threeUrl: {
    type: String,
    default: ''
},

// 请求头信息
headers: {
    type: Object,
    default () {
    return {}
    }
}
    • 0: 文本文件(txt, TXT, log, LOG)
    • 1: Word文档(doc, DOC, docx, DOCX)
    • 2: Excel文件(xls, XLS, xlsx, XLSX)
    • 3: PowerPoint文件(ppt, PPT, pptx, PPTX)
    • 4: PDF文件(pdf, PDF)
    • 5: 图片文件(png, PNG, jpg, JPG, jpeg, JPEG, gif, GIF, bmp, BMP)
    • 6: Photoshop文件(psd, PSD)
    • 7: 编程或配置文件(java, JAVA, c, C, cpp, CPP, cxx, CXX, sql, SQL, css, CSS, php, PHP, js, JS, jsp, JSP, py, PY, xml, XML, properties, PROPERTIES),但不包括crtx文件
    • 8: 压缩文件(zip, ZIP)
    • 9: 视频文件(mp4, MP4, mov, MOV, avi, AVI, flv, FLV, rmvb, RMVB, wmv, WMV, mpeg, MPEG, mkv, MKV, f4v, F4V, m4v, M4V, rm, RM, 3gp, 3GP, dat, DAT, ts, TS, mts, MTS, vob, VOB)
    • 10: 其他未知文件类型
    • 11: ai
    • 12: 音频文件(aac, amr, ape, flac, m4r, mmf, mp2, mp3, MP3, ogg, wav, wma, wv)
    • 13: 3D模型文件(obj, 3ds, stl, ply, gltf, off, 3dm, fbx, dae, wrl, 3mf, amf, ifc, brep, step, iges, fcstd, bim, igs, stp, glb)
    • 14: XMind思维导图文件(xmind)

Readme

Keywords

none

Package Sidebar

Install

npm i @fktest/vue-file-preview

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

12.8 MB

Total Files

43

Last publish

Collaborators

  • fktest