Does vue use computed Times as an unexpected side effect?

pass values from the parent component to the child component, and the child component receives and processes the data. The syntax error of eslint: Unexpected side effect in "logisticsList" computed property.eslint (vue/no-side-effects-in-computed-properties)

clipboard.png

computed: {
    logisticsList() {
      return this.list.OrderTrackInfo.reverse();
    },
}

operate through the methods of get and set

computed: {
    logisticsList: {
      get() {
        return this.list.OrderTrackInfo;
      },
      set() {
        // , reverse
        return this.list.OrderTrackInfo.reverse();
      },
    },
}
Jul.02,2022

one of the ways to solve this problem is to use watch to listen
for more information: https://blog.csdn.net/elie_ya...


logisticsList() {
   return Array.prototype.reverse.call(this.list.OrderTrackInfo);
},
Menu