Antd 多选选中的Item颜色或自定义样式 [英] Antd multiselect selected Item color or custom style

查看:55
本文介绍了Antd 多选选中的Item颜色或自定义样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 antd Antd multiselect

I am using this multi select of antd Antd multiselect

它工作得很好,但我想让它像这样 多选设计

It is working perfectly fine bt i want to make it like that Multiselect Design

每个选定的项目都有特定的颜色.这可以用 antd multiselect 吗?Antd 提供了一些像 labelInValue 这样的道具,但我很困惑如何使用它们没有提供足够的细节.

Each selected item have specific color.Is this possible with antd multiselect?Antd provides some props like labelInValue but i am confused how to use they have not provided enough detail.

推荐答案

您可以通过使用 css 或 less 变量来修改所选项目的颜色 链接到更少变量的 antd 说明.

You can modify the color of the selected items by using css or less variables link to antd instructions for less variables.

要使用css,打开node_modules文件夹,找到antd,打开es文件夹,打开你使用的antd组件,打开style文件夹,然后打开index.js文件.在那里您可以找到可以修改的 css 元素.创建一个 css 文件,更改 css 元素上的颜色属性,然后将 css 文件连接到您的 javascript/html 多选.

To use css, open the node_modules folder, find antd, open the es folder, open the antd component you're using, open the style folder, and then open the index.js file. There you can find the css elements you can modify. Create a css file, change the color attributes on the css elements, and then connect the css file to your javascript/html multiselect.

这篇关于Antd 多选选中的Item颜色或自定义样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆