相关疑难解决方法(0)

如何将自定义样式设置为antd Select?

我要自定义antd Select。当用户单击Selectantd时,Option应显示在antd上方,Select而不是显示在Select

antd Selecthttps://ant.design/components/select/

预期的行为:我要这个1个

实际行为:我不要这个2

JSX

import { FaPlane, FaWater } from "react-icons/fa";

//outside of class
const shipmentType = {
  sea: [
    { name: "FCL", desc: "FULL CONTAINER LOAD" },
    { name: "LCL", desc: "LESS CONTAINER LOAD" }
  ],
  air: [{ name: "AIR", desc: "AIR DELIVERY" }]
};


//inside of class

render(){
       return(
              <Select
              className="container-dropdown"
              onChange={this.onSelectChange}
              defaultValue={
                  <DisplayContainer data={shipmentType.sea[0]} />
              }
              key={ shipmentType.sea[0]}
            >
              <Option value={shipmentType.sea[0].name}> …
Run Code Online (Sandbox Code Playgroud)

javascript css reactjs antd

5
推荐指数
1
解决办法
136
查看次数

标签 统计

antd ×1

css ×1

javascript ×1

reactjs ×1