Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 9161405

Browse files
committed
feat: rc-page breadcrumb props add alfaExternal
1 parent 2234ec7 commit 9161405

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

‎packages/ui/xconsole-rc-page/package.json‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alicloud/xconsole-rc-page",
3-
"version": "2.3.30",
3+
"version": "2.4.0",
44
"main": "lib/index.js",
55
"module": "es/index.js",
66
"typings": "lib/index.d.ts",
@@ -27,13 +27,10 @@
2727
"@types/react": "^16.8.10",
2828
"@types/react-dom": "^16.8.3",
2929
"jest": "^24.2.0-alpha.0",
30-
"less": "^3.0.0-alpha.3",
31-
"prop-types": "^15.7.2",
3230
"react": "^16.8.6",
3331
"react-dom": "^16.8.6",
34-
"ts-jest": "^23.10.5",
35-
"tslint": "^5.8.0",
36-
"typescript": "^3.0.3"
32+
"react-router-dom": "^5.2.0",
33+
"typescript": "^4.9.0"
3734
},
3835
"scripts": {
3936
"prepublishOnly": "rm -rf dist lib es && npm run babel && npm run build && npm run babel:esm",
@@ -47,11 +44,12 @@
4744
"peerDependencies": {
4845
"prop-types": "^15.7.2",
4946
"react": "^16.8.6",
50-
"react-dom": "^16.8.6"
47+
"react-dom": "^16.8.6",
48+
"react-router-dom": "^5.2.0"
5149
},
5250
"dependencies": {
5351
"@alicloud/console-components-page": "^1.0.0",
52+
"@alicloud/xconsole-rc-base-link": "workspace:^2.4.5",
5453
"styled-components": "^4.4.0"
55-
},
56-
"gitHead": "a4fa53aa90b996e0a144c4fa010590763436de34"
54+
}
5755
}

‎packages/ui/xconsole-rc-page/src/Breadcrumb/index.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import React, { ReactElement } from 'react';
22
import { Breadcrumb } from '@alicloud/console-components-page';
33
import BaseLink from '@alicloud/xconsole-rc-base-link';
4-
import { Link } from 'dva/router';
4+
import { Link } from 'react-router-dom';
55

66
export interface IBreadcrumbItem extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
77
text: string;
88
link?: string;
99
to?: string;
10+
/**
11+
* 是否在渲染 a 标签时添加 data-alfa-external-router
12+
*/
13+
alfaExternal?: boolean;
1014
}
1115

1216
export interface IProps {
@@ -16,10 +20,10 @@ export interface IProps {
1620
const RcBreadcrumb = function ({ items = [] }: IProps): ReactElement {
1721
return (
1822
<Breadcrumb>
19-
{items.map(({ text, to, href, ...restProps }) => (
23+
{items.map(({ text, to, href, alfaExternal,...restProps }) => (
2024
<Breadcrumb.Item key={`${text}-${to}`}>
2125
{
22-
to ? <Link to={to} href={href} {...restProps}>{text}</Link> :
26+
to ? <Link to={to} href={href} {...restProps}data-alfa-external-router={alfaExternal||undefined}>{text}</Link> :
2327
href ? <BaseLink href={href} {...restProps}>{text}</BaseLink> : text
2428
}
2529
</Breadcrumb.Item>

‎packages/ui/xconsole-rc-page/tslint.json‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /