antd 操作相关

229 阅读1分钟

antd 如何修改某个组件的样式前缀

如图:使用config配置

对于$confirm这种外置的组件,通过prefixCls修改样式

transfer组件的使用:

antd 组件select 选择器设定了sufixIcon值之后,点击这个icon没有反应

解决方案:

<Select
    // 给icon设置这个属性,然后就好使了
    suffixIcon={<CaretDownOutlined style={{pointerEvents: 'none'}} />}
    >
</ Select>

antd button按钮disabled状态增加toast提示

使用一个更高位置的按钮来覆盖在这个按钮上
用div把按钮包起来,div里再加个绝对定位的元素,样式如下,给这个元素添加点击事件
  .mask {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    cursor: not-allowed;
  }