vuejs / vuex

🗃️ Centralized State Management for Vue.js.
https://vuex.vuejs.org
MIT License
28.4k stars 9.55k forks source link

vuex3.1.1版本 unregisterModule方法存在问题 #1610

Closed zjhILYxxq closed 4 years ago

zjhILYxxq commented 4 years ago

卸载一个不存在的动态module

源码:

unregister (path) {
    const parent = this.get(path.slice(0, -1))
    const key = path[path.length - 1]
    if (!parent.getChild(key).runtime) return

    parent.removeChild(key)
  }

如果要 卸载module父module 中不存在, parent.getChild(key) 返回 undefined ,会抛出异常: Cannot read property 'runtime' of undefined

vue-bot commented 4 years ago

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!


你好,你的 issue 不符合我们所要求的格式,因此已被自动关闭。为了确保每个 issue 都提供必需的相关信息,请务必使用我们的 Issue 向导 来创建新 issue,谢谢!