vue.js ref and vm.$refs取代$("#id")操作dom

在new Vue({

methods:{

    method:function(){

  
var $this = $(event.currentTarget);
var $third_level = $('#third_level');
var $second_level = $("#second_level");

//$("#select_all").attr('id',$this.attr('id'));
$(vm.$refs.select_all).attr("id",$this.attr('id'));

    }

})

posted @ 2017-11-08 19:59  tangchangcai  阅读(1549)  评论(0编辑  收藏  举报