You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.7 KiB

1 month ago
  1. ## breadcrumb 面包屑导航
  2. > **组件名:uni-breadcrumb**
  3. > 代码块: `ubreadcrumb`
  4. 显示当前页面的路径,快速返回之前的任意页面。
  5. ### 安装方式
  6. 本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
  7. 如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
  8. ### 基本用法
  9. 在 ``template`` 中使用组件
  10. ```html
  11. <uni-breadcrumb separator="/">
  12. <uni-breadcrumb-item v-for="(route,index) in routes" :key="index" :to="route.to">{{route.name}}</uni-breadcrumb-item>
  13. </uni-breadcrumb>
  14. ```
  15. ```js
  16. export default {
  17. name: "uni-stat-breadcrumb",
  18. data() {
  19. return {
  20. routes: [{
  21. to: '/A',
  22. name: 'A页面'
  23. }, {
  24. to: '/B',
  25. name: 'B页面'
  26. }, {
  27. to: '/C',
  28. name: 'C页面'
  29. }]
  30. };
  31. }
  32. }
  33. ```
  34. ## API
  35. ### Breadcrumb Props
  36. |属性名 |类型 |默认值 |说明 |
  37. |:-: |:-: |:-: |:-: |
  38. |separator |String |斜杠'/' |分隔符 |
  39. |separatorClass |String | |图标分隔符 class |
  40. ### Breadcrumb Item Props
  41. |属性名 |类型 |默认值 |说明 |
  42. |:-: |:-: |:-: |:-: |
  43. |to |String | |路由跳转页面路径 |
  44. |replace|Boolean | |在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录(仅 h5 支持) |
  45. ## 组件示例
  46. 点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/breadcrumb/breadcrumb](https://hellouniapp.dcloud.net.cn/pages/extUI/breadcrumb/breadcrumb)