从父组件传值给子组件, 子组件接收并处理数据, eslint的语法报错: Unexpected side effect in "logisticsList" computed property.eslint(vue/no-side-effects-in-computed-properties)
computed: { logisticsList() { return this.list.OrderTrackInfo.reverse(); }, }
通过get和set的方法操作
computed: { logisticsList: { get() { return this.list.OrderTrackInfo; }, set() { // 虽然不报错, 但是reverse的方法并不起效果 return this.list.OrderTrackInfo.reverse(); }, }, }
相关分类