Answer the question
In order to leave comments, you need to log in
Defining methods in the component. What is the difference?
Is there any difference between these three options?
Option 1
export default {
methods: {
test: () => {
alert(1);
}
},
mounted() {
this.test();
}
}
export default {
methods: {
test() {
alert(1);
}
},
mounted() {
this.test();
}
}
export default {
methods: {
test: function () {
alert(1);
}
},
mounted() {
this.test();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question