import { mapGetters } from 'vuex' export const roleMixin = { data() { return { isRoleDisabled: false } }, computed: { ...mapGetters([ 'userInfo' ]) }, mounted() { if (this.userInfo.roleId === 3) { this.searchForm.area = this.userInfo.area this.isRoleDisabled = true } } }