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
10 changes: 4 additions & 6 deletions packages/devui-vue/devui/steps-guide/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import type { App } from 'vue';
import StepsGuide from './src/steps-guide';
import StepsGuideDirective from './src/steps-guide-directive';

import StepsGuideDirective from './directive/steps-guide';
StepsGuide.install = function(app: App): void {
app.component(StepsGuide.name, StepsGuide);
};
export * from './src/steps-guide-types';

export { StepsGuide };
export { StepsGuide, StepsGuideDirective };

export default {
title: 'StepsGuide 操作指引',
category: '导航',
status: '80%',
install(app: App): void {
app.use(StepsGuide as any);
app.component(StepsGuide.name, StepsGuide);
app.directive('StepsGuide', StepsGuideDirective);
}
};
4 changes: 2 additions & 2 deletions packages/devui-vue/devui/steps-guide/src/steps-guide.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './steps-guide.scss';
import { computed, ref, defineComponent, Teleport, onMounted } from 'vue';
import { stepsGuideProps, StepsGuideProps, Step } from './steps-guide-types';
import { useStepsGuidePosition, useStepsGuideCtrl } from '../hooks';
import { useStepsGuidePosition, useStepsGuideCtrl } from '../composables';
import './steps-guide.scss';

export default defineComponent({
name: 'DStepsGuide',
Expand Down
46 changes: 26 additions & 20 deletions packages/devui-vue/docs/components/breadcrumb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### 基础面包屑

:::demo

```vue
<template>
<d-breadcrumb>
Expand All @@ -24,37 +25,41 @@
</d-breadcrumb>
</template>
```
:::

### 传入source
:::

### 传入 source

:::demo

```vue
<template>
<d-breadcrumb :source="source"></d-breadcrumb>
</template>
<script>
import { defineComponent, reactive } from 'vue'
import { defineComponent, reactive } from 'vue';

export default defineComponent({
name: "DBreadcrumbDemoSourceConfig",
name: 'DBreadcrumbDemoSourceConfig',
setup() {
const source = reactive([
{ title: 'DevUI', link: '/', linkType: 'routerLink', replace: true },
{ title: 'Breadcrumb', link: 'components/breadcrumb/', noNavigation: true }
])
{ title: 'Breadcrumb', link: 'components/breadcrumb/', noNavigation: true },
]);
return {
source,
}
};
},
})
});
</script>
```

:::

### 自定义分隔符的面包屑

:::demo

```vue
<template>
<div>
Expand All @@ -70,7 +75,7 @@ export default defineComponent({
<div>
<d-breadcrumb>
<template v-slot:separatorIcon>
<span style="color: red">></span>
<span style="color: red">></span>
</template>
<d-breadcrumb-item>
<a routerLink="/components/zh-cn/get-start">DevUI</a>
Expand All @@ -82,21 +87,22 @@ export default defineComponent({
</div>
</template>
```

:::

### Breadcrumb 参数

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

### BreadcrumbItem 参数

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

### 类型定义

Expand All @@ -106,9 +112,9 @@ export default defineComponent({
export interface SourceConfig {
title: string; // 显示的名称
link?: string; // 跳转的路径
target?: string // 规定在何处打开链接文档
target?: string; // 规定在何处打开链接文档
noNavigation?: boolean; // 链接是否不可跳转,一般用于当前所处位置不可跳转的配置
linkType?: 'hrefLink' | 'routerLink'; // 链接类型,默认为'hrefLink'方式,可选'hrefLink' 或 'routerLink'
replace: Boolean // 在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录
replace: Boolean; // 在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录
}
```
```
Loading