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>
  • 相关阅读:
    ActiveMQ持久化机制
    ActiveMQ的使用
    ActiveMQ解释
    Linux CentOS安装Tomcat
    nginx使用Keepalived
    Session共享解决方案
    Spring框架AOP使用扩展
    Myabtis测试(二)错题整理分析
    初识Spring及打印机案例
    MyBatis注解
  • 原文地址:https://www.cnblogs.com/lezuw/p/12746129.html
Copyright © 2011-2022 走看看