@lichunshan/pdf-preview
v1.0.4
Published
pdfjs-dist based mobile pdf preview component
Downloads
2
Maintainers
Readme
pdf-preview
基于pdfjs-dist的移动端vue pdf预览组件
Install
npm install @lichunshan/pdf-preview
Usage
在项目的main.js引入入下面代码全局注册组件
import pdfPreview from '@lichunshan/pdf-preview'
import '@lichunshan/pdf-preview/dist/pdf-preview.common.vendors~pdfjsWorker.js'
import '@lichunshan/pdf-preview/dist/pdf-preview.css'
import '@lichunshan/pdf-preview/src/assets/iconfont.css'
Vue.use(pdfPreview);
在.vue文件中使用
<pdf-preview src=""></pdf-preview>
src为pdf文件路径
Config
组件属性
| 属性(prop) | 值(value:Boolean) | 描述(desc) | | ------------ | -------------------- | --------------- | | toolbar | default(true) | 是否显示toolbar | | src | default('') | pdf文件路径 |