-
慕莱坞森
12345678910111213vue:var vm = new Vue({ el:'#main', data:{}, method:{ fn:function(){ }} jq:$('#main').click(function(){ vm.fn();)
-
慕哥6287543
从jquery触发Vue事件<ul class="menu"><li v-for="menu in menus"><a @click="clickMenu(menu)"><span class="title">{{ menu.title }}</span></a></li></ul>if(this.$route.path === '/') {this.$nextTick(()=>{$('.menu li:first-child').children('a')[0].dispatchEvent(new Event('click'));})}
-
慕沐林林
首先要安装jq:cnpm install jQuery然后在build/webpack.base.conf文件当中引入: