当前位置:网站首页>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.
(完)
边栏推荐
- Deng Qinglin, Alibaba Cloud Technical Expert: Best Practices for Disaster Recovery across Availability Zones and Multiple Lives in Different Locations on the Cloud
- 企业虚拟偶像产生了实质性的价值效益
- Hey, I had another fight with HR in the small group!
- The idea of the diagram
- Instance, 038: the sum of the diagonal matrix
- 工程制图名词解释-重点知识
- Example 035: Setting the output color
- html select tag assignment database query result
- JS 保姆级贴心,从零教你手写实现一个防抖debounce方法
- 实例036:算素数
猜你喜欢
v-model
Parquet encoding
SAP SD module foreground operation
C program compilation and predefined detailed explanation
SAP SD模块前台操作
参加Oracle OCP和MySQL OCP考试的学员怎样在VUE预约考试
esp32 releases robot battery voltage to ros2 (micro-ros+CoCube)
idea中diagram使用
第08章 索引的创建与设计原则【2.索引及调优篇】【MySQL高级】
mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf
随机推荐
What is SVN (Subversion)?
Flutter3.0线程——四步教你如何全方位了解(事件队列)
DDTL: Domain Transfer Learning at a Distance
Example 040: Reverse List
5. Scrapy middleware & distributed crawler
实例038:矩阵对角线之和
KunlunBase 1.0 is released!
多线程 之 JUC 学习篇章一 创建多线程的步骤
香港服务器有哪些常用的型号
融云「音视频架构实践」技术专场【内含完整PPT】
Download install and create/run project for HBuilderX
持续投入商品研发,叮咚买菜赢在了供应链投入上
C# 构造函数业务场景测试项目
How to copy baby from Taobao (or Tmall store) through API interface to Pinduoduo interface code docking tutorial
瑞能微计量芯片RN2026的实用程序
Deng Qinglin, Alibaba Cloud Technical Expert: Best Practices for Disaster Recovery across Availability Zones and Multiple Lives in Different Locations on the Cloud
出海季,互联网出海锦囊之本地化
v-model
简单的线性表的顺序表示实现,以及线性表的链式表示和实现、带头节点的单向链表,C语言简单实现一些基本功能
Flask Framework Beginner-06-Add, Delete, Modify and Check the Database