日常项目中需要动态去切换组件进行页面展示。
例如:登陆用户是“管理员”或者“普通用户”,需要根据登陆的用户角色切换页面展示的内容.则需要使用 :is 属性进行绑定切换
<template>
<div class="dashboard-container">
<component :is="currentRole"/>
</div>
</template>
<script>
import {
mapGetters
日常项目中需要动态去切换组件进行页面展示。
例如:登陆用户是“管理员”或者“普通用户”,需要根据登陆的用户角色切换页面展示的内容.则需要使用 :is 属性进行绑定切换
<template>
<div class="dashboard-container">
<component :is="currentRole"/>
</div>
</template>
<script>
import {
mapGetters