相關(guān)代碼class BaseStore { @observable statusTabActiveKey = 0}class ListStore extends BaseStore { @action.bound
handleTabChange(index) { super.statusTabActiveKey = index
}
}
const baseStore = new BaseStore()
const listStore = new ListStore()
export {
baseStore,
listStore,
}你期待的結(jié)果是什么?實(shí)際看到的錯(cuò)誤信息又是什么?希望baseStore.statusTabActiveKey可以根據(jù)listStore.handleTabChange(2)方法修改
【ES6 Class函數(shù)】子類(lèi)如何修改父類(lèi)屬性值?
陪伴而非守候
2019-01-02 17:24:58