VUE中使用jquery

 

 

首先要配置JQUERY使用

例,给文章详情图片添加缩略图

 

基于vant ui的 ImagePreview插件

 

import Vue from "vue";
import { ImagePreview } from ‘vant‘;
// 全局注册
Vue.use(ImagePreview);

export default {
  mounted(){
    this.$nextTick(function () {
        // 绑定图片缩略图
        $(‘.blog-content‘).on(‘click‘,‘img‘,function(){
          ImagePreview({
            images:[
              $(this).attr(‘src‘)
            ],
            showIndex:false
          });
        })
     })
  }
};

 

 

VUE中使用jquery

上一篇:js_if_and_for


下一篇:Pruning Filters For Efficient ConvNets 剪枝代码小结