我有一个vue组件和一个vue元素声明,如下所示Vue.component('todo-item',{template:'Thisisatodo'methods:{test:function(){//Iamgettinganerrorhereapp.aNewFunction();}}})varapp=newVue({el:'#app',data:{message:'HelloVue!'},methods:{aNewFunction:function(){alert("inside");}}})如何从vue组件调用vueapp中的方法? 最佳答案