javascript - vue组件中使用jquery ui的sortable,如何在其update事件中获取组件对象进行数据操作?
伊谢尔伦
伊谢尔伦 2017-04-10 17:25:41
0
1
355

代码如下

export default {
  name: 'testView',
  mounted() {
    $( "#sortable" ).sortable({
      update() {
                // 此处调用组件的数据或方法
                console.log(this);
            },
        });
    $( "#sortable" ).disableSelection();
  },
};

但是如果我需要在sortable的update事件中进行组件数据的修改或者调用组件的方法应该怎么做呢?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
巴扎黑

晕…解决了…先const定义一个变量等于this,update里面调用就好了…

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!