3👍
Your approach is trying to execute a function from the window
object or from whatever context was declared that object methods
.
You need to call that function as follow:
this.selecteStep(1);
Further, you need to separate those methods/functions using comma ,
const methods = {
selectStep: function (id) {
console.log('called!', id);
},
controlStep: function () {
this.selectStep(1);
}
}
methods.controlStep();
- [Vuejs]-How to limits an input to specific values without checking keycodes and without flickering the value?
- [Vuejs]-Vue.js textbox disappears with v-model keyword
2👍
You have to use this.anotherMethodName
<template>
...
<button @click="callMethod"></button>
...
</template>
<script>
export default {
methods: {
firstMethod() {
console.log('called')
},
callMethod() {
this.firstMethod()
}
}
}
</script>
- [Vuejs]-How to refactor a Vue instance into a working component
- [Vuejs]-DELETE route using vue-resource and laravel throwing 500 error
Source:stackexchange.com