Skip to content
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

🐛[BUG] 当出现 valueEnum 属性的时,text 组件被错误渲染为 select 组件 #9002

Open
condorheroblog opened this issue Feb 8, 2025 · 0 comments

Comments

@condorheroblog
Copy link

🐛 bug 描述

指定表格的 valueType 为 text,但当出现 valueEnum 的时候,组件就被渲染为 select 组件了,不在是输入框组件。

📷 复现步骤

在线链接:

https://stackblitz.com/edit/vitejs-vite-tst7qpsn?file=src%2Fdemo.tsx

表格表头代码:

  const columns: ProColumns<DataSourceType>[] = [
    {
      title: 'This is a text component',
      dataIndex: 'title',
      width: '20%',
     // 这里
      valueType: 'text',
      valueEnum: {
        all: { text: 'All', status: 'Default' },
        open: {
          text: 'open',
          status: 'Error',
        },
        closed: {
          text: 'closed',
          status: 'Success',
        },
      },
    },
    {
      title: 'Status',
      key: 'state',
      dataIndex: 'state',
      valueType: 'select',
      valueEnum: {
        all: { text: 'All', status: 'Default' },
        open: {
          text: '未解决',
          status: 'Error',
        },
        closed: {
          text: '已解决',
          status: 'Success',
        },
      },
    },
  ];

第一列应该是一个输入框,因为指定了 valueEnum 被错误渲染为 Select 组件了。

Image

🏞 期望结果

Image

© 版本信息

  • ProComponents 版本: 2.8.4
  • ant design 5.24.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant