如果只是想抽象的话,写到一个单独的js文件中,再引用就行了。如: import * as getters from '...' export default { vuex: { getter } } 或者一次性全引入: export default { vuex: { getters: { store: store => store } } } 调用时,this.store.xxx即可。
如果只是想抽象的话,写到一个单独的js文件中,再引用就行了。
如:
或者一次性全引入:
调用时,this.store.xxx即可。