一、vue2

1、安装

npm install v-viewer@1.6.4
npm i -S viewerjs

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、使用

<el-carousel :interval="4000"  arrow="always" height="150px"
                           :autoplay="true" :loop="true" indicator-position="none"
                           style="width: 350px;margin-left: 7px">
                <el-carousel-item v-for="(item,index) in point.carouselList" :key="index">
                    <img :src="item" style="width: 100%;height: 100%;background-size: contain" v-viewer>
                </el-carousel-item>
              </el-carousel>

 

posted on 2024-05-21 10:54  周文豪  阅读(43)  评论(0编辑  收藏  举报