当前位置:网站首页>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:类的方法与变量
- Engineering drawing review questions (with answers)
- Security First: Tools You Need to Know to Implement DevSecOps Best Practices
- 参加Oracle OCP和MySQL OCP考试的学员怎样在VUE预约考试
- Oracle迁移到瀚高之后,空值问题处理
- 计算首屏时间
- MySQL高级-读写分离-分库分表
- Intranet penetration - application
- Sticker Spelling - Memory Search / Shape Pressure DP
- The idea of the diagram
猜你喜欢

Engineering drawing review questions (with answers)

一篇文章看懂JS闭包,从执行上下文角度解析有趣的闭包

Presto中broadcast join和partition join执行计划的处理过程

Snake game bug analysis and function expansion

nodejs installation and environment configuration

2022焊工(初级)上岗证题目模拟考试平台操作

JS 从零教你手写节流throttle

SAP SD module foreground operation

Use of lombok annotation @RequiredArgsConstructor

云开发校园微社区微信小程序源码/二手交易/兼职交友微信小程序开源源码
随机推荐
内网穿透-应用
可变字符串
html select tag assignment database query result
flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原
天地图坐标系转高德坐标系 WGS84转GCJ02
工程制图平面投影练习
持续投入商品研发,叮咚买菜赢在了供应链投入上
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
DHCP服务详解
实例035:设置输出颜色
(cf)Codeforces Round #811 (Div. 3)A--E详细题解
Small Turtle Compilation Notes
Multithreading JUC Learning Chapter 1 Steps to Create Multithreading
LDO investigation
sudo 权限控制,简易
Example 039: Inserting elements into an ordered list
简单的线性表的顺序表示实现,以及线性表的链式表示和实现、带头节点的单向链表,C语言简单实现一些基本功能
【Untitled】
Priority_queue element as a pointer, the overloaded operators
【原创】启动Win10自带的XPS/OXPS阅读器