亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vue實現(xiàn)動態(tài)面包屑導(dǎo)航

 更新時間:2022年04月13日 10:54:05   作者:風(fēng)如也  
這篇文章主要為大家詳細介紹了vue實現(xiàn)動態(tài)面包屑導(dǎo)航的使用方法,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了vue實現(xiàn)動態(tài)面包屑導(dǎo)航的具體代碼,供大家參考,具體內(nèi)容如下

動態(tài)面包屑導(dǎo)航是根據(jù)路由中的matched獲取到的
單獨提取出面包屑導(dǎo)航欄組件

<template>
? <el-breadcrumb class="app-breadcrumb" separator="/">
? ? <transition-group name="breadcrumb">
? ? ? <el-breadcrumb-item v-for="item in levelList" :key="item.path" :to="{ path: item.path }">
? ? ? ? <span>{{ item.meta.title }}</span>
? ? ? </el-breadcrumb-item>
? ? </transition-group>
? </el-breadcrumb>
</template>

<script>
export default {
? data () {
? ? return {
? ? ? levelList: null
? ? }
? },
? watch: {
? ? $route () {
? ? ? this.getBreadcrumb()
? ? }
? },
? created() {
? ? this.getBreadcrumb()
? },
? methods: {
? ? getBreadcrumb () {
? ? ? let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
? ? ? const first = matched[0]
? ? ? if (!this.isIndex(first)) {
? ? ? ? matched = [{ path: '/index', meta: { title: '首頁' } }].concat(matched)
? ? ? ? this.levelList = matched
? ? ? } else {
? ? ? ? this.levelList = [{ path: '/index', meta: { title: '首頁' } }]
? ? ? }
? ? },
? ? isIndex (route) {
? ? ? const redirect = route && route.redirect
? ? ? if (!redirect) {
? ? ? ? return false
? ? ? }
? ? ? return redirect === '/index'
? ? }
? },
}
</script>

<style lang="scss">
/* breadcrumb transition */
.breadcrumb-enter-active,
.breadcrumb-leave-active {
? transition: all .5s;
}

.breadcrumb-enter,
.breadcrumb-leave-active {
? opacity: 0;
? transform: translateX(20px);
}

.breadcrumb-move {
? transition: all .5s;
}

.breadcrumb-leave-active {
? position: absolute;
}

.app-breadcrumb.el-breadcrumb {
? margin-left: 8px;
}
</style>

在布局組件中應(yīng)用

<!-- 面包屑 -->
<dBreadcrumb class="breadcrumb-container" />

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue中l(wèi)et that=this的作用及說明

    vue中l(wèi)et that=this的作用及說明

    這篇文章主要介紹了vue中l(wèi)et that=this的作用及說明,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-10-10
  • vue打包后的線上部署Apache、nginx全過程

    vue打包后的線上部署Apache、nginx全過程

    這篇文章主要介紹了vue打包后的線上部署Apache、nginx全過程,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-02-02
  • Vue Cli 3項目使用融云IM實現(xiàn)聊天功能的方法

    Vue Cli 3項目使用融云IM實現(xiàn)聊天功能的方法

    這篇文章主要介紹了Vue Cli 3項目 使用融云IM實現(xiàn)聊天功能,本文通過實例代碼給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-04-04
  • Vue實現(xiàn)簡單登錄界面

    Vue實現(xiàn)簡單登錄界面

    這篇文章主要為大家詳細介紹了Vue實現(xiàn)簡單登錄界面,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-06-06
  • Vuex 入門教程

    Vuex 入門教程

    這篇文章主要介紹了Vuex 入門教程,Vuex 是一個專為 Vue.js 應(yīng)用程序開發(fā)的狀態(tài)管理模式, 那這個 vuex 怎么用呢?就具體來看一下吧
    2018-01-01
  • 利用Vue+intro.js實現(xiàn)頁面新手引導(dǎo)流程功能

    利用Vue+intro.js實現(xiàn)頁面新手引導(dǎo)流程功能

    在同學(xué)們使用某些網(wǎng)站的新版本頁面的時候,經(jīng)常會出現(xiàn)一個類似于新手引導(dǎo)一樣的效果,來幫助同學(xué)們更好的熟悉新版本頁面的功能和使用,這篇文章主要給大家介紹了關(guān)于如何利用Vue+intro.js實現(xiàn)頁面新手引導(dǎo)流程功能的相關(guān)資料,需要的朋友可以參考下
    2023-11-11
  • vue?父子組件共用mixins的注意點

    vue?父子組件共用mixins的注意點

    這篇文章主要介紹了vue?父子組件共用mixins的注意點,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-04-04
  • vue實現(xiàn)下拉框的多選功能(附后端處理參數(shù))

    vue實現(xiàn)下拉框的多選功能(附后端處理參數(shù))

    本文介紹了如何使用Vue實現(xiàn)下拉框的多選功能,實現(xiàn)了在選擇框中選擇多個選項的功能,文章詳細介紹了實現(xiàn)步驟和示例代碼,對于想要了解如何使用Vue實現(xiàn)下拉框多選功能的讀者具有一定的參考價值
    2023-08-08
  • Vue3中的h函數(shù)及使用小結(jié)

    Vue3中的h函數(shù)及使用小結(jié)

    這篇文章主要介紹了Vue3中的h函數(shù)及使用小結(jié),本文通過實例代碼給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2023-03-03
  • design vue 表格開啟列排序的操作

    design vue 表格開啟列排序的操作

    這篇文章主要介紹了design vue 表格開啟列排序的操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-10-10

最新評論