我運行ESLint和我目前運行到以下ESLint錯誤:Eslint狀態已經宣佈[Vuex]
error 'state' is already declared in the upper scope no-shadow
const state = {
date: '',
show: false
};
const getters = {
date: state => state.date,
show: state => state.show
};
const mutations = {
updateDate(state, payload) {
state.date = payload.date;
},
showDatePicker(state) {
state.show = true;
}
};
export default {
state,
getters,
mutations
};
什麼是解決這一問題的最好方法是什麼?
以及那些獲得 「無PARAM-重新分配」 錯誤,這是解決方案: /* eslint無PARAM-重新分配:[ 「錯誤」,{「道具「:true,」ignorePropertyModificationsFor「:[」state「]}] * / – kospol