ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## 安装 ``` npm install --save vue-picture-preview ``` ## 使用 ### 在项目的入口文件处进行配置 ``` import vuePicturePreview from 'vue-picture-preview' Vue.use(vuePicturePreview) ``` ### 在根路由处进行添加插槽 ``` <!-- Vue root compoment template --> <div id="app"> <router-view></router-view> <lg-preview></lg-preview> </div> ``` ### 对于所有图片都可以使用 v-preview 指令来绑定他们的预览功能 ``` <img v-for="img in imgs" v-preview="img" :src="img"> export default { data () { return { imgs: ['http://covteam.u.qiniudn.com/ka2.jpg', 'http://covteam.u.qiniudn.com/poster.png'] } } } ```