Vue使用v-viewer實現(xiàn)圖片預覽
更新時間:2020年10月21日 12:01:33 作者:Wang_kaiya
這篇文章主要為大家詳細介紹了Vue使用v-viewer實現(xiàn)圖片預覽,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了Vue使用v-viewer實現(xiàn)圖片預覽的具體代碼,供大家參考,具體內容如下
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="image"/> </viewer> </van-swipe-item> </van-swipe>
效果

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
vue3 onMounted異步函數(shù)同步請求async/await實現(xiàn)
這篇文章主要為大家介紹了vue3 onMounted初始化數(shù)據(jù)異步函數(shù)/同步請求async/await實現(xiàn)詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-07-07
Element中el-tabs左右滑動動畫的實現(xiàn)
本篇博客將詳細介紹如何在使用 Vue 以及 Element UI 時,實現(xiàn)一個具有左右滑動效果的 tab 切換動畫,文中通過示例代碼介紹的非常詳細,需要的朋友們下面隨著小編來一起學習學習吧2024-03-03

