Modal.config({rootPrefixCls:'sm-ant'})//配置相关cls


message.config({prefixCls:"sm-ant-message"})
notification.config({prefixCls:"sm-ant-notification"})//message和notification按照这种方式配置

<ConfigProvider
      locale={zh_CN}
      prefixCls="sm-ant"
      dropdownMatchSelectWidth={false}
      getPopupContainer={(node) => {
        // 解决下拉框随着滚动条的滚动会出现错位情况
        if (node && node.parentElement) {
          return node.parentElement;
        }
        return document.body;
      }}
    >
      {renderRoutes(routes)}
    </ConfigProvider>


//调用
 const onClickDelete = (data: IParamsConfig) => {
    Modal.confirm({
      title: "你确定要删除吗?",
      icon: <ExclamationCircleOutlined />,
      okText: "确认",
      cancelText: "取消",
      onOk: () => deleteParamConfig(data.id, equId)
    });
  };

Logo

一站式 AI 云服务平台

更多推荐