[Vuejs]-How to handle changing props inside a component

0👍

You could possibly use v-model. as the docs will say, it’s shorthand for the child component having a property bound from the parent and when a change event occurs you emit an update event from the child to the parent to have the parent update the property, and the child will subsequently sync to the new value.

ie:

childComponent *has value change*
  onChange (value) => this.$emit("updateValue", value)

parentComponent *recieved "updateValue" event*
  onUpdateValue(value) => this.parentValue = value

Leave a comment