【发布时间】:2017-10-06 04:37:06
【问题描述】:
我正在运行 ESLint,目前遇到以下 ESLint 错误:
错误 'state' 已在上层范围 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
};
解决此问题的最佳方法是什么?
【问题讨论】: