<template>
|
<div>
|
<component :is="showComponent"></component>
|
</div>
|
</template>
|
|
<script>
|
import {mapGetters} from "vuex";
|
import adminIndex from './adminIndex.vue';
|
import workIndex from './workIndex.vue';
|
|
export default {
|
name: "wel",
|
components:{adminIndex,workIndex},
|
data() {
|
return {
|
showComponent: null, // 初始不显示任何组件
|
};
|
},
|
computed: {
|
...mapGetters(["userInfo"]),
|
},
|
watch: {
|
'userInfo.userId'() {
|
//是管理员进入管理员首页
|
if(this.userInfo.userId.includes('admin')){
|
this.showComponent=adminIndex;
|
}else {
|
this.showComponent=workIndex;
|
}
|
}
|
},
|
created() {
|
//是管理员进入管理员首页
|
if(this.userInfo.userId.includes('admin')){
|
this.showComponent=adminIndex;
|
}else {
|
this.showComponent=workIndex;
|
}
|
},
|
methods: {
|
|
},
|
};
|
</script>
|
|
<style>
|
.el-font-size {
|
font-size: 14px;
|
}
|
|
.avue-text-ellipsis__text {
|
font-size: 14px !important;
|
}
|
|
#chart {
|
width: 100%;
|
height: 309px;
|
}
|
</style>
|