当前位置:网站首页>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.
(完)
边栏推荐
- sql有关问题,小时粒度,找到前一个小时内的数据
- TensoFlow学习记录(二):基础操作
- initramfs详解----添加硬盘驱动并访问磁盘
- mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf
- Multithreading JUC Learning Chapter 1 Steps to Create Multithreading
- 企业虚拟偶像产生了实质性的价值效益
- 5. Scrapy middleware & distributed crawler
- pytorch应用于MNIST手写字体识别
- html select tag assignment database query result
- LeetCode:899. 有序队列【思维题】
猜你喜欢
5. Scrapy middleware & distributed crawler
initramfs详解----添加硬盘驱动并访问磁盘
持续投入商品研发,叮咚买菜赢在了供应链投入上
Flask Framework Beginner-05-Command Management Manager and Database Use
2022 China Computing Power Conference released the excellent results of "Innovation Pioneer"
The idea of the diagram
pytorch应用于MNIST手写字体识别
Small Turtle Compilation Notes
Continuing to pour money into commodities research and development, the ding-dong buy vegetables in win into the supply chain
Zabbix设置邮件告警+企业微信告警
随机推荐
22/8/3(板子)树状dp板子+中国剩余定理+求组合数3,4+容斥原理
TensoFlow学习记录(二):基础操作
阿里云国际版基于快照与镜像功能迁移云服务器数据
Promise 解决阻塞式同步,将异步变为同步
在更一般意义上验算移位距离和假设
Small Turtle Compilation Notes
2022 China Computing Power Conference released the excellent results of "Innovation Pioneer"
MallBook联合人民交通出版社,推动驾培领域新发展,开启驾培智慧交易新生态
织梦内核电动伸缩门卷闸门门业公司网站模板 带手机版【站长亲测】
Web APIs BOM- 操作浏览器:swiper 插件
QNX Hypervisor 2.2用户手册]10.2 vdev 8259
KunlunBase 1.0 is released!
Example: 036 is a prime number
LeetCode:899. 有序队列【思维题】
5. Scrapy middleware & distributed crawler
可变字符串
简单排序(暑假每日一题 14)
工程制图名词解释-重点知识
LDO investigation
Flask Framework Beginner-06-Add, Delete, Modify and Check the Database