Answer the question
In order to leave comments, you need to log in
How to call another component method from mounted?
how to call products() method from mounted?
Vue.component('hello-world', {
template: '#hello-world-template',
data : function () {
return{message : 'привет',
products : [0,1,2,2,3]}
},
mounted : function () {
this.products()
},
methods : {
products : function () {
alert()
}
}
})
Answer the question
In order to leave comments, you need to log in
You are doing everything right, only your variable and the products function have the same name, there will be a collision.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question