[Vuejs]-Changing props from child in parent Vuejs

6👍

You can emit event to parent

showFirstTabFunc () {
  this.$emit('setActiveTab', 'showFirstTab')
}

In Parent

<app-tabs @setActiveTab="setActiveTab"></app-tabs>

methods: {
  setActiveTab (activeTab) {
    this.showFirstTab = false
    this.showSecondTab = false
    this.showThirdTab = false
    this.showTabFour = false
    this[activeTab] = true
  }
}
👤ittus

Leave a comment