Skip to content

Table中有空数据时设置默认文本显示,column可自定义默认文本,并且优先级高于table #2109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Augly
Copy link

@Augly Augly commented Apr 17, 2020

首先,感谢你的贡献! 😄

新特性请提交至 feature 分支,其余可提交至 master 分支。在一个维护者审核通过后合并。请确保填写以下 pull request 的信息,谢谢!~

[English Template / 英文模板]

这个变动的性质是

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 组件样式改进
  • TypeScript 定义更新
  • 重构
  • 代码风格优化
  • 分支合并
  • 其他改动(是关于什么的改动?)

需求背景

  1. 当Tblle中有空数据时,需要显示默认文本。
  2. 需要将新的tableDefaultText属性添加到Table组件中,以默认显示空数据。 为了在列数据为空时使列自定义默认文本,需要将columnDefaultText属性添加到该列,并且columnDefaultText的优先级高于tableDefaultText。

实现方案和 API(非新功能可选)

  1. 默认情况下,将新的tableDefaultText属性添加到表组件以显示空数据。 要在列数据为空时自定义列的默认文本,需要将columnDefaultText属性添加到该列,并且columnDefaultText的优先级高于tableDefaultText。 没有为列设置columnDefaultText。 在该列的最终呈现文本中,如果数据为空,则使用columnDefaultText.
  2. 将新的tableDefaultText属性添加到表组件以显示空数据。 要在列数据为空时自定义列的默认文本,需要将columnDefaultText属性添加到该列,并且columnDefaultText的优先级高于tableDefaultText。 没有为列设置columnDefaultText。 在该列的最终呈现文本中,如果数据为空,则使用columnDefaultText。

对用户的影响和可能的风险(非新功能可选)

  1. 当table表存在空数据时,空数据会显示默认的tableDefaultText,如果自定义了columnDefaultText,则该列中的空数据会显示columnDefaultTex的值

Changelog 描述(非新功能可选)

  1. Table.jsx adds the tableDefaultText property, and adds the value of tableDefaultText to columnDefaultText if the columnDefaultText value is not set in column in the renderTable method. Added corresponding properties to TableProps and ColumnProps in interface.js, and added columnDefaultText for this column by default when the text is empty in TableCell.jsx
  2. Table.jsx添加tableDefaultText属性,如果未在renderTable方法的column中设置columnDefaultText值,则将tableDefaultText的值添加到columnDefaultText。 在TableCell.jsx中,当文本为空时,在interface.js中为TableProps和ColumnProps添加了相应的属性,并且默认情况下为此列添加了columnDefaultText。
    修改了components\vc-table\src\Table.jsx,components\table\Table.jsx,components\table\interface.js,components\vc-table\src\Column.jsx 4个文件
    增加了antdv-demo\tableDefaultText.md文档说明

请求合并前的自查清单

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

后续计划(非新功能可选)

如果这个提交后面还有相关的其他提交和跟进信息,可以写在这里。

@tangjinzhou
Copy link
Member

b55fa75
看下这个提交

@tangjinzhou
Copy link
Member

你的这个方案有点复杂 我先关了

zhoudewei2526 pushed a commit to zhoudewei2526/ant-design-vue that referenced this pull request Apr 23, 2020
@Augly
Copy link
Author

Augly commented Apr 25, 2020

你的这个方案有点复杂 我先关了

好的

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants