判斷當前路由,指定元件顯示與否

qq_39704803發表於2020-10-26

檢視當前路由
 

{{this.$route.path}}

判斷如果不是首頁,則顯示麵包屑
 

 <div class="breadcrumb-container" v-if="this.$route.path != '/home'">
        <el-breadcrumb class="common-container" separator="/">
            <el-breadcrumb-item :to="{ path: '/' }">首頁</el-breadcrumb-item>
            <el-breadcrumb-item><a href="/">活動管理</a></el-breadcrumb-item>
            <el-breadcrumb-item>活動列表</el-breadcrumb-item>
            <el-breadcrumb-item>活動詳情</el-breadcrumb-item>
        </el-breadcrumb>
    </div>


 

相關文章