Handling unexpected side effect in computed properties - VueJS

前端 未结 4 476
闹比i
闹比i 2021-01-07 23:12

In the following code, I\'m trying to use the getTranslation object to map values present in originalKeys array and push the values in a new array

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 23:30

    ESLint is showing this error because you are mutating the original data in computed property. It is recommended that you should return new references or data from computed property.Follow this link for detailed explanation. https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-side-effects-in-computed-properties.md

提交回复
热议问题