Skip to content

Commit 2410530

Browse files
committed
feat: [Format] value 内容变化,重新计算是否展示 tooltip
1 parent 530efde commit 2410530

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/components/c-table/columnTpl/link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function LinkTpl({ value, row, linkKey, link, onClick, line = 1,
1717
setTooltipContent(value);
1818
}
1919
}
20-
}, [tooltipValue]);
20+
}, [value, tooltipValue]);
2121

2222
if (isVoid(value)) {
2323
return '-';

src/components/c-table/columnTpl/text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function TextTpl({ value, line = 1, tooltipValue }) {
1717
setTooltipContent(value);
1818
}
1919
}
20-
}, [tooltipValue]);
20+
}, [value, tooltipValue]);
2121

2222
if (isVoid(value)) {
2323
return '-';

src/components/format/demos/link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ desc: 链接格式化模板,支持点击跳转、自定义点击事件
77
```jsx
88
/**
99
* title: 链接格式化
10-
* desc: 链接格式化模板,支持点击跳转、自定义点击事件
10+
* desc: 链接格式化模板,支持点击跳转、自定义点击事件、文本超长展示Tooltip,不超长不展示Tooltip
1111
*/
1212
import React from "react";
1313
import { Format } from "cloud-react";

src/components/format/demos/text.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ desc: 文本格式化模板,支持多行显示、Tooltip提示
77
```jsx
88
/**
99
* title: 文本格式化
10-
* desc: 文本格式化模板,支持多行显示、Tooltip提示
10+
* desc: 文本格式化模板,支持多行显示、文本超长展示Tooltip,不超长不展示Tooltip
1111
*/
1212
import React from "react";
1313
import { Format } from "cloud-react";

src/components/format/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ group:
7575

7676
## 代码演示
7777

78-
### 数字格式化
79-
80-
<embed src="@components/format/demos/number.md" />
81-
8278
### 文本格式化
8379

8480
<embed src="@components/format/demos/text.md" />
8581

82+
### 链接格式化
83+
84+
<embed src="@components/format/demos/link.md" />
85+
8686
### 时间格式化
8787

8888
<embed src="@components/format/demos/time.md" />
@@ -91,6 +91,6 @@ group:
9191

9292
<embed src="@components/format/demos/time-range.md" />
9393

94-
### 链接格式化
94+
### 数字格式化
9595

96-
<embed src="@components/format/demos/link.md" />
96+
<embed src="@components/format/demos/number.md" />

0 commit comments

Comments
 (0)