Within a method on a Vue instance you can access other methods on the instance using this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
var vm = new Vue({ ... methods: { methodA() { // Method A }, methodB() { // Method B // Call `methodA` from inside `methodB` this.methodA() }, }, ... }); |
To access a method outside of a Vue instance you can assign the instance to a variable (such as vm in the example above) and call the method:
1 |
vm.methodA(); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.