Commit a6ac516 1 parent d0b29ab commit a6ac516 Copy full SHA for a6ac516
File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -68,12 +68,12 @@ export default defineComponent({
68
68
const { proxy } = getCurrentInstance ( ) ;
69
69
70
70
const handleClick = ( ) => {
71
- if ( props . href ) {
72
- window . location . href = props . href ;
73
- }
74
71
const router = props . router || proxy . $router ;
72
+
75
73
if ( props . to && router ) {
76
74
props . replace ? router . replace ( props . to ) : router . push ( props . to ) ;
75
+ } else {
76
+ window . location . href = props . href ;
77
77
}
78
78
} ;
79
79
const bindEvent = ( e : MouseEvent ) => {
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ theme | String | light | 组件风格。可选项:light | N
23
23
content | String / Slot / Function | - | 子元素。TS 类型:` string \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts ) | N
24
24
default | String / Slot / Function | - | 子元素,同 content。TS 类型:` string \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts ) | N
25
25
disabled | Boolean | - | 是否禁用当前项点击 | N
26
- href | String | - | 跳转链接 | N
26
+ href | String | - | 跳转链接,不能与 to 共用 | N
27
27
icon | Slot / Function | - | 面板屑项内的前置图标。TS 类型:` TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts ) | N
28
28
maxWidth | String | undefined | 最大宽度,超出后会以省略号形式呈现。优先级高于 Breadcrumb 中的 maxItemWidth | N
29
29
replace | Boolean | false | 路由跳转是否采用覆盖的方式(覆盖后将没有浏览器历史记录) | N
30
30
router | Object | - | 路由对象。如果项目存在 Router,则默认使用 Router。TS 类型:` any ` | N
31
31
target | String | _ self | 链接或路由跳转方式。可选项:_ blank/_ self/_ parent/_ top | N
32
- 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
32
+ to | String / Object | - | 路由跳转目标,当且仅当 Router 存在时,该 API 有效。不能与 href 共用。 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
33
33
onClick | Function | | TS 类型:` (e: MouseEvent) => void ` <br />点击时触发 | N
34
34
35
35
### BreadcrumbItem Events
You can’t perform that action at this time.
0 commit comments