Vue使用v-viewer實現(xiàn)圖片預(yù)覽
本文實例為大家分享了Vue使用v-viewer實現(xiàn)圖片預(yù)覽的具體代碼,供大家參考,具體內(nèi)容如下
1.安裝依賴
npm install v-viewer --save
2.在main.js中引入
import Viewer from ’v-viewer’ //圖片查看插件import ’viewerjs/dist/viewer.css’Vue.use(Viewer)Viewer.setDefaults({ Options: { ’inline’: true, ’button’: true, ’navbar’: true, ’title’: true, ’toolbar’: true, ’tooltip’: true, ’movable’: true, ’zoomable’: true, ’rotatable’: true, ’scalable’: true, ’transition’: true, ’fullscreen’: true, ’keyboard’: true, ’url’: ’data-source’ } })
3.在組件中引用
<van-swipe :autoplay='3000'> <van-swipe-item v-for='(image, index) in moodsImg' :key='index'> <viewer :images = 'moodsImg' > <img :src='http://m.lshqa.cn/bcjs/image'/> </viewer> </van-swipe-item></van-swipe>
效果
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. Python2.6版本pip安裝步驟解析2. python公司內(nèi)項目對接釘釘審批流程的實現(xiàn)3. python中Ansible模塊的Playbook的具體使用4. Python自動化之定位方法大殺器xpath5. Python本地及虛擬解釋器配置過程解析6. Python 利用flask搭建一個共享服務(wù)器的步驟7. 基于python實現(xiàn)matlab filter函數(shù)過程詳解8. Python中Anaconda3 安裝gdal庫的方法9. python自動化測試三部曲之request+django實現(xiàn)接口測試10. Python importlib模塊重載使用方法詳解
