当前位置:网站首页>Ant - the design of the Select component using a custom icon (suffixIcon attribute) suffixes, click on the custom ICONS have no reaction, will not display the drop-down menu
Ant - the design of the Select component using a custom icon (suffixIcon attribute) suffixes, click on the custom ICONS have no reaction, will not display the drop-down menu
2022-08-04 02:09:00 【Frost and snow away】
一. 问题原因
custom icons are usedant-design的Icon图标组件
我是在ant-design-reactThis problem occurs in the project of ,估计ant-design-vue中也会这样.
import {
CaretDownOutlined } from '@ant-design/icons'
import {
Select } from 'antd'
<Select
size='large'
showArrow
bordered={
false}
value={
selTransactionType}
options={
transactionOptions}
onChange={
handleTransactionTypeChange}
suffixIcon={
<CaretDownOutlined style={
{
fontSize: '15px', color: '#CBD0DB' }} />}
/>

点击SelectAll other sections can display drop-down boxes,Only clicking on the icon does not respond.
二. 解决办法
让UIThe students cut the arrow out,Put it in the form of a label
import {
CaretDownOutlined } from '@ant-design/icons'
import {
Select, Image } from 'antd'
<Select
size='large'
showArrow
bordered={
false}
value={
selTransactionType}
options={
transactionOptions}
onChange={
handleTransactionTypeChange}
suffixIcon={
<Image
src={
'https://XXXXXXXXXX/date-icon.png'}
alt='coverImage'
preview={
false}
style={
{
width: '16px', height: '16px' }}
/>
<img
src={
'https://XXXXXXXXXX/date-icon.png'}
alt='coverImage'
style={
{
width: '16px', height: '16px' }}
/>
}
/>
若是使用ant-design的Image组件,ant-design的ImageThe component comes with a preview image function,记得需要将preview置为false.
或者直接用img标签即可.

The dropdown box can now be displayed regardless of whether the icon is clicked or anywhere else.
(完)
边栏推荐
- 实例041:类的方法与变量
- 工程制图平面投影练习
- 网页三维虚拟展厅为接入元宇宙平台做基础
- Slipper - virtual point, shortest path
- nodejs installation and environment configuration
- Taurus.MVC WebAPI 入门开发教程1:框架下载环境配置与运行(含系列目录)。
- 工程制图复习题
- 织梦内核电动伸缩门卷闸门门业公司网站模板 带手机版【站长亲测】
- FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
- Flask框架初学-05-命令管理Manager及数据库的使用
猜你喜欢

esp32 releases robot battery voltage to ros2 (micro-ros+CoCube)

idea中diagram使用

Security First: Tools You Need to Know to Implement DevSecOps Best Practices

融云「音视频架构实践」技术专场【内含完整PPT】

MySQL高级-读写分离-分库分表

云开发旅游打卡广场微信小程序源码(含视频教程)

Continuing to pour money into commodities research and development, the ding-dong buy vegetables in win into the supply chain

mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf

html select标签赋值数据库查询结果

5.scrapy中间件&分布式爬虫
随机推荐
STM32-遥感数据处理
香港服务器有哪些常用的型号
Taurus.MVC WebAPI 入门开发教程1:框架下载环境配置与运行(含系列目录)。
各位大佬好,麻烦问一下flink cdc oracle写入doris的时候,发现cpu异常,一下下跑
ssh服务详解
halcon自定义函数基本操作
web端动效 lottie-web 使用
v-model
参加Oracle OCP和MySQL OCP考试的学员怎样在VUE预约考试
贪吃蛇游戏Bug解析及功能扩展
持续投入商品研发,叮咚买菜赢在了供应链投入上
TensoFlow学习记录(二):基础操作
Hey, I had another fight with HR in the small group!
flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原
Snake game bug analysis and function expansion
splice随机添加和删除的写法
Kubernetes:(九)coredns(浪不动了)
Simple sorting (summer vacation daily question 14)
sql有关问题,小时粒度,找到前一个小时内的数据
How to copy baby from Taobao (or Tmall store) through API interface to Pinduoduo interface code docking tutorial