vue2-file-preview
v1.0.4
Published
Picture Preview
Downloads
12
Readme
vue2-file-preview
一个基于Vue2的文件展示预览插件,支持缩放、旋转、拖拽
特性
安装
npm i vue2-file-preview --save
使用
在入口文件main.js
中加入以下代码:
import Preview from "vue2-file-preview"
Vue.use(Preview)
import 属于异步引用组件,需要特殊的 babel-loader 处理,一般框架都自带,如果没有可安装babel-plugin-dynamic-import-node
在Vue组件中使用
<Preview :imgList="['http://imgurl1','http://imgurl2']" />