gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
Untitled conversation
- User
{ title: , dataIndex: 'readBytes', render: (dom, entity) => ( <div style={{ display: 'flex', flexWrap: 'nowrap' }}> {entity.readBytes!.map((item) => ( <svg style={{ display: 'inline-block', width: '5px', height: '5px', marginRight: '2px' }} > ))} ), }, как к каждому svg прикрепить tooltip?
- Assistant
Можно использовать компонент
Tooltipиз библиотеки antd и обернуть каждыйsvgв этот компонент, передав нужный текст в свойствоtitle. Примерно так:import { Tooltip } from 'antd'; ... {entity.readBytes!.map((item, index) => ( <Tooltip title={`Tooltip text ${index}`}> <svg style={{ display: 'inline-block', width: '5px', height: '5px', marginRight: '2px' }}> <circle cx="2.5" cy="2.5" r="2.5" stroke="#888" strokeWidth="1" fill="#1890ff" /> </svg> </Tooltip> ))}Таким образом, каждый
svgбудет обернут в компонентTooltipс нужным текстом, который будет появляться при наведении на элемент.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.