我有分量如何点击整个vuejs组件
,我想点击后运行方法
<my-component @click="showOtherDiv"></my-component>
我对主应用程序的方法
var app = new Vue({
el: '#app',
data: {},
methods: {
showOtherDiv : function(){
alert('Some message');
}
}
});
这种方法但似乎像“点击”不适用于全部组件
它应该工作。你能提供一个codepen或jsfiddle – CodinCat