Skip to content

Conversation

@uyarn
Copy link
Collaborator

@uyarn uyarn commented Oct 10, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

复现示例

import React, { useState } from 'react';

import { Select } from 'tdesign-react';

const { Option } = Select;

const options = [
  { label: '用户一', value: '1', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户二', value: '2', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户三', value: '3', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户四', value: '4', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户五', value: '5', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户六', value: '6', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户七', value: '7', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户八', value: '8', description: '这是一段用户描述信息,可自定义内容' },
  { label: '用户九', value: '9', description: '这是一段用户描述信息,可自定义内容' },
];

const options2 = [];

const avatarUrl = 'https://tdesign.gtimg.com/site/avatar.jpg';

export default function CustomOptions() {
  const [value, setValue] = useState('1');
  const onChange = (value: string) => {
    setValue(value);
  };

  return (
    <Select value={value} onChange={onChange} style={{ width: '300px' }} clearable>
      {options2.map((option, idx) => (
        <Option style={{ height: '60px' }} key={idx} value={option.value} label={option.label}>
          <div style={{ display: 'flex' }}>
            <img
              src={avatarUrl}
              style={{
                maxWidth: '40px',
                borderRadius: '50%',
              }}
            />
            <div style={{ marginLeft: '16px' }}>
              <div>{option.label}</div>
              <div
                style={{
                  fontSize: '13px',
                  color: 'var(--td-gray-color-9)',
                }}
              >
                {option.description}
              </div>
            </div>
          </div>
        </Option>
      ))}
    </Select>
  );
}

💡 需求背景和解决方案

📝 更新日志

  • fix: 修复使用虚拟滚动的组件在使用子组件配合异步请求场景的组件告警问题

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 10, 2025

tdesign-react-demo

npm i https://pkg.pr.new/tdesign-react@3876

commit: f9ca6c9

@github-actions
Copy link
Contributor

完成

@uyarn uyarn merged commit 108d7e1 into develop Oct 10, 2025
13 checks passed
@uyarn uyarn deleted the fix/async-option-slot branch October 10, 2025 03:56
@github-actions github-actions bot mentioned this pull request Oct 10, 2025
16 tasks
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

Successfully merging this pull request may close these issues.

4 participants