-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: breadcrumb item support click event (#238)
- Loading branch information
Showing
16 changed files
with
333 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/products/tdesign-vue-next/src/breadcrumb/breadcrumb.en-US.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### Breadcrumb Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
maxItemWidth | String | undefined | \- | N | ||
options | Array | - | Typescript:`Array<TdBreadcrumbItemProps>` | N | ||
separator | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
theme | String | light | options: light | N | ||
|
||
|
||
### BreadcrumbItem Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
content | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
default | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
disabled | Boolean | - | \- | N | ||
href | String | - | \- | N | ||
icon | Slot / Function | - | prefix icon in breadcrumb item。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
maxWidth | String | undefined | \- | N | ||
replace | Boolean | false | \- | N | ||
router | Object | - | Typescript:`any` | N | ||
target | String | _self | options: _blank/_self/_parent/_top | N | ||
to | String / Object | - | Typescript:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`。[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/breadcrumb/type.ts) | N | ||
onClick | Function | | Typescript:`(e: MouseEvent) => void`<br/>trigger on click | N | ||
|
||
### BreadcrumbItem Events | ||
|
||
name | params | description | ||
-- | -- | -- | ||
click | `(e: MouseEvent)` | trigger on click |
36 changes: 36 additions & 0 deletions
36
packages/products/tdesign-vue-next/src/breadcrumb/breadcrumb.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### Breadcrumb Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
maxItemWidth | String | undefined | 单项最大宽度,超出后会以省略号形式呈现 | N | ||
options | Array | - | 面包屑项,功能同 BreadcrumbItem。TS 类型:`Array<TdBreadcrumbItemProps>` | N | ||
separator | String / Slot / Function | - | 自定义分隔符。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
theme | String | light | 组件风格。可选项:light | N | ||
|
||
|
||
### BreadcrumbItem Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
content | String / Slot / Function | - | 子元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
default | String / Slot / Function | - | 子元素,同 content。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
disabled | Boolean | - | 是否禁用当前项点击 | N | ||
href | String | - | 跳转链接 | N | ||
icon | Slot / Function | - | 面板屑项内的前置图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N | ||
maxWidth | String | undefined | 最大宽度,超出后会以省略号形式呈现。优先级高于 Breadcrumb 中的 maxItemWidth | N | ||
replace | Boolean | false | 路由跳转是否采用覆盖的方式(覆盖后将没有浏览器历史记录) | N | ||
router | Object | - | 路由对象。如果项目存在 Router,则默认使用 Router。TS 类型:`any` | N | ||
target | String | _self | 链接或路由跳转方式。可选项:_blank/_self/_parent/_top | N | ||
to | String / Object | - | 路由跳转目标,当且仅当 Router 存在时,该 API 有效。TS 类型:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`。[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/breadcrumb/type.ts) | N | ||
onClick | Function | | TS 类型:`(e: MouseEvent) => void`<br/>点击时触发 | N | ||
|
||
### BreadcrumbItem Events | ||
|
||
名称 | 参数 | 描述 | ||
-- | -- | -- | ||
click | `(e: MouseEvent)` | 点击时触发 |
33 changes: 33 additions & 0 deletions
33
packages/products/tdesign-vue-next/src/breadcrumb/props.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdBreadcrumbProps } from './type'; | ||
import { PropType } from 'vue'; | ||
|
||
export default { | ||
/** 单项最大宽度,超出后会以省略号形式呈现 */ | ||
maxItemWidth: { | ||
type: String, | ||
default: undefined, | ||
}, | ||
/** 面包屑项,功能同 BreadcrumbItem */ | ||
options: { | ||
type: Array as PropType<TdBreadcrumbProps['options']>, | ||
}, | ||
/** 自定义分隔符 */ | ||
separator: { | ||
type: [String, Function] as PropType<TdBreadcrumbProps['separator']>, | ||
}, | ||
/** 组件风格 */ | ||
theme: { | ||
type: String as PropType<TdBreadcrumbProps['theme']>, | ||
default: 'light' as TdBreadcrumbProps['theme'], | ||
validator(val: TdBreadcrumbProps['theme']): boolean { | ||
if (!val) return true; | ||
return ['light'].includes(val); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/products/tdesign-vue/src/breadcrumb/breadcrumb.en-US.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### Breadcrumb Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
maxItemWidth | String | undefined | \- | N | ||
options | Array | - | Typescript:`Array<TdBreadcrumbItemProps>` | N | ||
separator | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
theme | String | light | options: light | N | ||
|
||
|
||
### BreadcrumbItem Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
content | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
default | String / Slot / Function | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
disabled | Boolean | - | \- | N | ||
href | String | - | \- | N | ||
icon | Slot / Function | - | prefix icon in breadcrumb item。Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
maxWidth | String | undefined | \- | N | ||
replace | Boolean | false | \- | N | ||
router | Object | - | Typescript:`any` | N | ||
target | String | _self | options: _blank/_self/_parent/_top | N | ||
to | String / Object | - | Typescript:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`。[see more ts definition](https://github.com/Tencent/tdesign-vue/tree/develop/src/breadcrumb/type.ts) | N | ||
onClick | Function | | Typescript:`(e: MouseEvent) => void`<br/>trigger on click | N | ||
|
||
### BreadcrumbItem Events | ||
|
||
name | params | description | ||
-- | -- | -- | ||
click | `(e: MouseEvent)` | trigger on click |
36 changes: 36 additions & 0 deletions
36
packages/products/tdesign-vue/src/breadcrumb/breadcrumb.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### Breadcrumb Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
maxItemWidth | String | undefined | 单项最大宽度,超出后会以省略号形式呈现 | N | ||
options | Array | - | 面包屑项,功能同 BreadcrumbItem。TS 类型:`Array<TdBreadcrumbItemProps>` | N | ||
separator | String / Slot / Function | - | 自定义分隔符。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
theme | String | light | 组件风格。可选项:light | N | ||
|
||
|
||
### BreadcrumbItem Props | ||
|
||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
content | String / Slot / Function | - | 子元素。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
default | String / Slot / Function | - | 子元素,同 content。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
disabled | Boolean | - | 是否禁用当前项点击 | N | ||
href | String | - | 跳转链接 | N | ||
icon | Slot / Function | - | 面板屑项内的前置图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N | ||
maxWidth | String | undefined | 最大宽度,超出后会以省略号形式呈现。优先级高于 Breadcrumb 中的 maxItemWidth | N | ||
replace | Boolean | false | 路由跳转是否采用覆盖的方式(覆盖后将没有浏览器历史记录) | N | ||
router | Object | - | 路由对象。如果项目存在 Router,则默认使用 Router。TS 类型:`any` | N | ||
target | String | _self | 链接或路由跳转方式。可选项:_blank/_self/_parent/_top | N | ||
to | String / Object | - | 路由跳转目标,当且仅当 Router 存在时,该 API 有效。TS 类型:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/breadcrumb/type.ts) | N | ||
onClick | Function | | TS 类型:`(e: MouseEvent) => void`<br/>点击时触发 | N | ||
|
||
### BreadcrumbItem Events | ||
|
||
名称 | 参数 | 描述 | ||
-- | -- | -- | ||
click | `(e: MouseEvent)` | 点击时触发 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdBreadcrumbProps } from './type'; | ||
import { PropType } from 'vue'; | ||
|
||
export default { | ||
/** 单项最大宽度,超出后会以省略号形式呈现 */ | ||
maxItemWidth: { | ||
type: String, | ||
default: undefined, | ||
}, | ||
/** 面包屑项,功能同 BreadcrumbItem */ | ||
options: { | ||
type: Array as PropType<TdBreadcrumbProps['options']>, | ||
}, | ||
/** 自定义分隔符 */ | ||
separator: { | ||
type: [String, Function] as PropType<TdBreadcrumbProps['separator']>, | ||
}, | ||
/** 组件风格 */ | ||
theme: { | ||
type: String as PropType<TdBreadcrumbProps['theme']>, | ||
default: 'light' as TdBreadcrumbProps['theme'], | ||
validator(val: TdBreadcrumbProps['theme']): boolean { | ||
if (!val) return true; | ||
return ['light'].includes(val); | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.