[Vuejs]-How to change data in some situations?

0👍

Set watchers on your props to set the data items from the props.

watch: {
  src(newValue) {
    this.mutatedSrc = newValue;
  },
  symbolId(newValue) {
    this.symbolId = newValue;
  },
  photoId(newValue) {
    this.mutatedPhotoId = newValue;
  },
  index(newValue) {
    this.mutatedIndex = newValue;
  }
}

Leave a comment