Нашел метод в watch Vue.js 😄
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
stringInput (newVal, oldVal) { // todo: adjust timing // console.log('new:' + newVal) // console.log('old:' + oldVal) switch (newVal) { // services case 'Our Services': this.selected = 0 break // projects case 'Projects': this.selected = 1 break // team case 'Team Members': this.selected = 2 break // pricing case 'Pricing': this.selected = 3 break // else default: this.selected = 0 break } this.showChange(this.selected) } |