Breadcrumb 面包屑

基本用法

```schema: scope=”body” { “type”: “breadcrumb”, “items”: [ { “label”: “首页”, “href”: “https://baidu.gitee.com/“, “icon”: “fa fa-home” },

  1. {
  2. "label": "上级页面"
  3. },
  4. {
  5. "label": "当前页面"
  6. }

] }

  1. ## 动态数据
  2. 可以配置 source 来获取上下文中的动态数据,结合 [service](service) 来实现动态生成。
  3. ```schema
  4. {
  5. "type": "page",
  6. "data": {
  7. "breadcrumb": [
  8. {
  9. "label": "首页",
  10. "href": "https://baidu.gitee.com/"
  11. },
  12. {
  13. "label": "上级页面"
  14. },
  15. {
  16. "label": "当前页面"
  17. }
  18. ]
  19. },
  20. "body": {
  21. "type": "breadcrumb",
  22. "source": "${breadcrumb}"
  23. }
  24. }

分隔符

```schema: scope=”body” { “type”: “breadcrumb”, “separator”: “>”, “separatorClassName”: “text-black”, “items”: [ { “href”: “https://baidu.gitee.com/“, “icon”: “fa fa-home” },

  1. {
  2. "label": "上级页面"
  3. },
  4. {
  5. "label": "当前页面"
  6. }

] }

  1. ## 下拉菜单
  2. ```schema: scope="body"
  3. {
  4. "type": "breadcrumb",
  5. "separator": ">",
  6. "separatorClassName": "text-black",
  7. "items": [
  8. {
  9. "label": "首页",
  10. "href": "https://baidu.gitee.com/",
  11. "icon": "fa fa-home"
  12. },
  13. {
  14. "label": "上级页面",
  15. "dropdown": [
  16. {
  17. "label": "选项一",
  18. "href": "https://baidu.gitee.com/",
  19. },
  20. {
  21. "label": "选项二"
  22. }
  23. ]
  24. },
  25. {
  26. "label": "当前页面"
  27. }
  28. ]
  29. }

最大展示长度

```schema: scope=”body” { “type”: “breadcrumb”, “separator”: “>”, “separatorClassName”: “text-black”, “labelMaxLength”: 16, “tooltipPosition”: “top”, “items”: [ { “href”: “https://baidu.gitee.com/“, “icon”: “fa fa-home” },

  1. {
  2. "label": "上级页面上级页面上级页面上级页面上级页面"
  3. },
  4. {
  5. "label": "当前页面"
  6. }

] } ```

属性表

属性名 类型 默认值 说明
className string 外层类名
itemClassName string 导航项类名
separatorClassName string 分割符类名
dropdownClassName string 下拉菜单类名
dropdownItemClassName string 下拉菜单项类名
separator string 分隔符
labelMaxLength number 16 最大展示长度
tooltipPosition `top \ bottom \ left \ right` top 浮窗提示位置
source string 动态数据
items[].label string 文本
items[].href string 链接
items[].icon string 图标
items[].dropdown dropdown[] 下拉菜单,dropdown[]的每个对象都包含label、href、icon属性