zoukankan      html  css  js  c++  java
  • el-image组件大图预览定位当前图片

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="UTF-8">
      <!-- import CSS -->
      <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    </head>
    <body>
    <div id="app">
      <div class="block" v-for="(url, index) in urls">
        <el-image
          style=" 100px; height: 100px"
          :src="url"
          :preview-src-list="getSrcList(index)"></el-image>
      </div>
    </div>
    </body>
    <!-- import Vue before Element -->
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <!-- import JavaScript -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script>
    new Vue({
      el: '#app',
      data: {
        urls: [
          'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
          'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
          'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
        ]
      },
      methods:{
        getSrcList(index){
          return this.urls.slice(index).concat(this.urls.slice(0,index))
        }
      }
    })
    </script>
    </html>
  • 相关阅读:
    4. 归并排序
    3. 堆排序
    2. 希尔排序
    1. 选择排序、插入排序、冒泡排序
    1. 拓扑排序
    8. 最大堆
    7. B+树
    6. B树
    5. 二叉查找树、平衡二叉树、红黑树的效率比较
    4. 红黑二叉树
  • 原文地址:https://www.cnblogs.com/lezuw/p/12746129.html
Copyright © 2011-2022 走看看