Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/devui-vue/devui/breadcrumb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import type { App } from 'vue';
import Breadcrumb from './src/breadcrumb';
import BreadcrumbItem from './src/breadcrumb-item';

Breadcrumb.install = function (app: App): void {
app.component(Breadcrumb.name, Breadcrumb);
app.component(BreadcrumbItem.name, BreadcrumbItem);
};
export * from './src/breadcrumb-types';
export * from './src/breadcrumb-item-types';

export { Breadcrumb };

Expand All @@ -14,6 +12,7 @@ export default {
category: '导航',
status: '50%',
install(app: App): void {
app.use(Breadcrumb as any);
app.component(Breadcrumb.name, Breadcrumb);
app.component(BreadcrumbItem.name, BreadcrumbItem);
},
};
16 changes: 7 additions & 9 deletions packages/devui-vue/docs/components/breadcrumb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ export default defineComponent({
```
:::

### 可下拉的面包屑【TODO】
### 自定义分隔符的面包屑

:::demo
```vue
<template>
<div>
<d-breadcrumb separatorIcon=">">
<d-breadcrumb separator-icon=">">
<d-breadcrumb-item>
<a routerLink="/components/zh-cn/get-start">DevUI</a>
</d-breadcrumb-item>
Expand All @@ -84,25 +83,24 @@ export default defineComponent({
</template>
```
:::
### API

### d-breadcrumb 参数
### Breadcrumb 参数

| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
| :-----------: | :------------------------------------: | :--: | :------------------------------------------------- | --------------------------------------------- |
| separatorIcon | [`string`](#自定义分隔符的面包屑) | '/' | 可选,自定义分隔符样式 | [自定义分隔符的面包屑](#自定义分隔符的面包屑) |
| source | [`Array<SourceConfig>`](#SourceConfig) | [] | 可选,面包屑根据配置的 source 按照默认渲染方式显示 | [传入source](#传入source) |
| separator-icon | `string` | '/' | 可选,自定义分隔符样式 | [自定义分隔符的面包屑](#自定义分隔符的面包屑) |
| source | [SourceConfig\[\]](#sourceconfig) | [] | 可选,面包屑根据配置的 source 按照默认渲染方式显示 | [传入source](#传入source) |

### d-breadcrumb-item 参数
### BreadcrumbItem 参数

| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
| :------: | :--------------------------------: | :---: | :-----------------------------------------------------: | :-------------------------------- |
|to | `string/object` | — | 路由跳转对象,同 vue-router 的 to | [基础面包屑](#基础面包屑) |
|replace| `boolean` | false | 在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录 | [基础面包屑](#基础面包屑) |

### 接口 & 类型定义
### 类型定义

### SourceConfig
#### SourceConfig

```ts
export interface SourceConfig {
Expand Down