亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - vue el mounts the same instance repeatedly
歐陽克
歐陽克 2017-06-26 10:51:57
0
1
961

I mounted an element to the element when I clicked it, but as soon as I loaded the page, it was triggered manually, causing an instance to be mounted to the element. Then I click on the element which causes it to be mounted repeatedly. How do I cancel the last mount? (I know this method is not very reasonable, but it has been done like this now)

The project is a bit big
Let me give you a rough idea
$(a).click(function(){

var vue=new Vue({
    el:"掛鉤的元素",
    data:{},
    methods:{}
})

}
$(document).ready(function(){

   $(a).trigger('click'); 

});
When the page is loaded, an element is hooked, and then when element a is clicked, element a will be hooked again

歐陽克
歐陽克

溫故而知新,可以為師矣。 博客:www.ouyangke.com

reply all(1)
大家講道理

Your description is difficult for everyone to understand. It is really difficult to answer without posting the code.
Based on your literal meaning, I suggest you set a bool variable, control it with v-if, and then change the value of the variable by clicking.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template