工学云
150.99MB · 2026-02-11
适用于 Vuex 2 的 VS Code 插件,提供 跳转定义、代码补全 和 悬浮提示 功能。支持 State, Getters, Mutations 和 Actions。
从组件中直接跳转到 Vuex Store 的定义处。
this.$store.state/getters/commit/dispatchmapState, mapGetters, mapMutations, mapActions智能提示 Vuex 的各种 Key 以及组件中映射的方法。
dispatch 中提示 Actions,在 commit 中提示 Mutations。mapState('user', [...]) 时,会自动过滤并仅显示 user 模块下的内容。this. 即可提示映射的方法(例如 this.increment 映射自 ...mapMutations(['increment']))。...mapActions({ alias: 'name' }))。无需跳转即可查看文档、类型详情。
/** ... */ 注释文档。(State) appName: string)。同样支持在 Vuex Store 内部 代码补全、跳转、悬浮提示。
user.js)中编写 Action 时,commit 和 dispatch 的代码补全会自动过滤并仅显示当前模块的内容。同样支持在 Vuex Store 内部 代码补全、跳转、悬浮提示。
...mapState(['count'])
...mapState('user', ['name']) // 命名空间支持
...mapActions({ add: 'increment' }) // 对象别名支持
...mapActions(['add/increment'])
this.$store.commit("SET_NAME", value);
this.$store.dispatch("user/updateName", value);
this.increment(); // 映射自 mapMutations
this.appName; // 映射自 mapState
src/store/index.js 或 src/store/index.ts(支持自动探测)。vuexHelper.storeEntry。vuexHelper.storeEntry: 手动指定 Store 入口文件路径。支持:
@/store/index.js (需在 jsconfig/tsconfig 中配置)src/store/index.js/User/xxx/project/src/store/index.js初始版本,支持功能: