main.js引入该js 就可以在页面中调用函数了
// 全局混入 它将影响每一个之后创建的 Vue 实例。
import Vue from 'vue'
import { mapGetters } from 'vuex'
Vue.mixin({
computed: {
// 将 store中的 getter过滤参数 "platformGetter" 注册全局
...mapGetters({
// 外部调用:this.mixinUserInfo
'mixinUserInfo': 'platformGetter',
})
},
data() {
return {
// 外部调用:this.organizations
organizations: []
}
},
methods: {
// 客户列表
getPlatform() {
// 外部调用:this.getPlatform()
}
}
})