ant-design / ant-design/pro-components
🧐[BUG] ProTable 数据源通过 request 获取,valueType指定相应类型,然后启用了ellipsis,如何让其tooltip显示与文本内容一致的提示呀!这种情况应该怎么处理呢?
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🧐 问题描述
ProTable ProTable 数据源通过 request 获取,valueType指定相应类型,然后启用了ellipsis,如何让其tooltip显示与文本内容一致的提示呀!!目前我dataIndex是一个数字,通过request获取通过valueType去处理。但是我使用了ellipsis后 tooltip显示的是数据源的数字。不是valueType转换后的文本。这个就有点尴尬了!
### 💻 示例代码
```
{
title: '保险公司',
dataIndex: 'subdivision_company_id',
width: 150,
ellipsis: {
showTitle: true,
},
order: 18,
formItemProps: { label: '保险公司' },
valueType: 'cascader',
fieldProps: {
showSearch: true,
},
search: {
transform: (value) => {
if (Array.isArray(value) && value.length > 0) {
return { subdivision_company_id: value.pop() };
}
return { subdivision_company_id: undefined };
},
},
request: async () => {
const res = await queryInsuranceCompanyCascader();
if (res.code === 0) {
return res.data.list || [];
}
return [];
},
}
```
### 🚑 其他信息
这种情况应该怎么处理呢?
Contributor guide
Research direction
Start by reproducing the provided ProTable column configuration with request data, valueType: 'cascader', and ellipsis.showTitle. Compare the tooltip value with the rendered cell text; the issue is done when the tooltip displays the same valueType-transformed text rather than the numeric data source value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100