最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue v-viewer組件使用示例詳解(v-viewer輪播圖)

 更新時間:2023年02月09日 09:31:24   作者:長安依舊  
這篇文章主要介紹了vue v-viewer組件使用示例詳解(v-viewer輪播圖),本文結(jié)合實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

v-viewer輪播圖

效果圖

Bandicam(錄制視頻)+soogif(視頻轉(zhuǎn)成gif)

在這里插入圖片描述

實(shí)現(xiàn)效果:
輪播圖+縮放、旋轉(zhuǎn)照片

組件介紹

vue 預(yù)覽圖片研究過v-viewer及基于photoswipe的vue-photo-preview插件。
相同點(diǎn):
兩者都可以實(shí)現(xiàn)預(yù)覽、放大、切換圖片(輪播圖效果)的功能,
差異:
1.vue-photo-preview頁面效果會比v-viewer好看些;
2.vue-photo-preview雖然可以實(shí)現(xiàn)放大圖片的功能,但是放大倍數(shù)不可進(jìn)行調(diào)整,v-viewer可隨意放大及縮?。?br />3.v-viewer另外提供旋轉(zhuǎn)、翻轉(zhuǎn)功能(由于拍攝的照片各種角度都有,若圖片預(yù)覽具有旋轉(zhuǎn)功能,超加分);

插件安裝

安裝

npm install v-viewer

配置main.js

  import 'viewerjs/dist/viewer.css'
  import Viewer from 'v-viewer'
  import Vue from 'vue'
  Vue.use(Viewer)

代碼實(shí)現(xiàn)

<template>
  <div  style="height: 500px;width: 800px;background-color: #222222">
    <viewer class="viewer" ref="viewer" :options="optionsViewer" :images="pics"
            style="width: 100%;height: 100%;background-size: contain;background-repeat: no-repeat;
                background-position: center;background-color: #3e5c9a;">
      <img v-for="(img, index) in pics" :src="img"
           :key="index" style="opacity: 0.2;display: none;width: 400px;height: 300px;background-color: #42b983;"/>
    </viewer>
  </div>

</template>

<script>
  export default {
    name: 'App',
    components: {},
    data() {
      return {
        optionsViewer: {
          zIndex: 99999,
          inline: true,
          button: false,
          navbar: true,
          title: false,
          toolbar: true,
          tooltip: true,
          movable: true,
          zoomable: true,
          rotatable: true,
          scalable: true,
          transition: true,
          fullscreen: false,
          keyboard: true,
          url: 'data-source'
        },
        pics: ['https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943',
          'https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943',
          'https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943',
          'https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943',
          'https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943'],
      }
    },
  }
</script>

<style lang="scss" scoped>

</style>

備注:由于多個地方用了v-viewer,但僅僅想修改部分頁面的默認(rèn)配置,可參考上面代碼。若是作用于整個項(xiàng)目,可將配置添加到main.js文件。

參考:v-viewer

補(bǔ)充:v-viewer的使用(vue)

下載插件

npm install v-viewer --save

在需要使用的頁面進(jìn)行導(dǎo)入

import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
import Vue from 'vue'
Vue.use(Viewer)

在定義一個div用來存放img

<div v-viewer>
? ? ? <img />
</div>

這樣就好了?。。?/p>

到此這篇關(guān)于vue v-viewer組件使用的文章就介紹到這了,更多相關(guān)vue v-viewer組件使用內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論

大石桥市| 珠海市| 锡林郭勒盟| 都江堰市| 包头市| 佛学| 大丰市| 曲麻莱县| 阳泉市| 漠河县| 读书| 鹤山市| 孟津县| 手游| 陵川县| 濮阳市| 新巴尔虎右旗| 扶沟县| 日土县| 安阳县| 肇庆市| 加查县| 新竹县| 延庆县| 柏乡县| 阿尔山市| 泰和县| 宣恩县| 略阳县| 基隆市| 渝中区| 岳池县| 方正县| 乡宁县| 内黄县| 黎城县| 璧山县| 桦南县| 轮台县| 江源县| 资溪县|