我想在按钮单击后发出警报。
这是我的代码,它不起作用:
const supervue = new vue({
el:'#test',
methods:{
hi(){
return alert('hello world');
}
},
components:{
"abc" : abc,
}
})
const subvue = {
props:['propsdata'],
templates: ' <button v-on:click="propsdata.hi">click!</button>'
}
<div id="test">
<abc v-bind:propsdata="supervue"></abc>
<file-wrap v-bind:propsdata="fileWrapData"></file-wrap>
</div>
谢谢。