当前位置: 首页 > news >正文

element-plus的面包屑组件el-breadcrumb

面包屑组件主要用来显示当页面路径,以及快速返回之前的页面。
涉及2个组件
el-breadcrumb 和el-breadcrumb-item,

el-breadcrumb的spearator指定item的分隔符

el-breadcrumb-item的to和replace属性和vue-router的一致,需要结合vue_router一起使用

用法如下

<script setup lang="ts">
import { aG } from 'vitest/dist/reporters-LqC_WI4d.js';
import { onMounted, reactive, ref, watch } from 'vue'
import { RouterLink, RouterView,useRoute,useRouter } from 'vue-router'</script><template><div><el-container><el-header></el-header><el-main><el-breadcrumb separator="/"><el-breadcrumb-item :to="{path:'/'}">homepage</el-breadcrumb-item><el-breadcrumb-item :to="{path:'/about'}">a</el-breadcrumb-item><el-breadcrumb-item :to="{path:'/test'}">b</el-breadcrumb-item><el-breadcrumb-item :to="{path:'/test'}">c</el-breadcrumb-item><el-breadcrumb-item :to="{path:'/test'}">d</el-breadcrumb-item></el-breadcrumb><router-view v-slot="{ Component }"><keep-alive ><component :is="Component" :key="$route.fullPath" /></keep-alive></router-view></el-main><el-footer></el-footer></el-container></div></template><style scoped></style>

vue-router配置如下

import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ChatRoom from '@/components/ChatRoom.vue';const router = createRouter({history: createWebHashHistory(import.meta.env.BASE_URL),routes: [{path: '/',name: 'home',component: HomeView},{path: '/about',name: 'about',// route level code-splitting// this generates a separate chunk (About.[hash].js) for this route// which is lazy-loaded when the route is visited.component: ChatRoom}]
})export default router

在这里插入图片描述
文档链接
https://element-plus.org/zh-CN/component/breadcrumb.html

http://www.lryc.cn/news/439238.html

相关文章:

  • 推荐几个网盘资源站给大伙,找资源更方便
  • 【Qt】Qml界面中嵌入C++ Widget窗口
  • Python快速入门 —— 第五节:接口开发
  • 利用secureCRT向虚拟机发送文件(secureCRT安装使用教程)
  • AI杂七杂八系列(1)——工程篇
  • 学习大数据DAY58 增量抽取数据表
  • HTTPTomcat
  • Python数据分析-Matplotlib快速入门
  • 重塑在线软件开发新纪元:集成高效安全特性,深度解析与评估支持浏览器在线编程的系统架构设计
  • 【鸿蒙OH-v5.0源码分析之 Linux Kernel 部分】003 - vmlinux.lds 链接脚本文件源码分析
  • MongoDB实现高级RAG:Parent-Document检索技术详解
  • 胡学乱想----前端知识点(css色彩)
  • GEE 案例——利用MODIS数据和NDWI指数进行美国五大湖水体计算和时序分析(直方图统计和面积统计)
  • 【jvm】记一次hive堆heap内存溢出的排查
  • 编译运行 webAssembly(wasm)
  • Linux bash 关联数组
  • 选择排序
  • SQL数据库(MySQL)
  • 在MindSearch中使用SiliconCloud:全面指南**
  • C++(2)之Linux多线程服务端编程总结
  • 【AI视频】复刻抖音爆款AI数字人作品初体验
  • Mysql 面试题总结
  • stack - queue
  • 微软九月补丁星期二发现了 79 个漏洞
  • 研1日记12
  • Rocky Linux 9安装mysqlclient库报错的解决方法
  • Spring Boot母婴商城:安全、便捷、高效
  • php实现kafka
  • YOLOv10改进系列,YOLOv10损失函数更换为Powerful-IoU(2024年最新IOU),助力高效涨点
  • 工具知识 | Linux 常用命令参考手册