如何才能在函数内调用函数?通过v-on调用函数内部功能:点击
模板:(HTML)
<a v-on:click="hello.world"></a>
JS:(作为组分)
methods: {
hello: function() {
return {
world: function() {
alert('hello world');
}
};
}
}
这我得到了警告:
[Vue公司警告]:事件 “点击” 无效的处理程序:得到未定义
这可能是通过JS 调用this.hello().world()
但不是在模板(HTML)像v-on
我错过了什么?
使用它像这样''foo是 –
!!!!! ,应该是@BelminBedak的答案吧! – l2aelba