wangzongming / qnn-react-cron

基于react和antd开发的cron表达式生成组件 React and Antd based cron expression generation components
85 stars 13 forks source link

在引入qnn-react-cron之后,对antd的样式造成了影响 #14

Closed yuxuejiao closed 2 years ago

yuxuejiao commented 2 years ago

原来的样式:

Screen Shot 2022-06-09 at 1 48 02 PM

在引入qnn-react-cron之后的样式:

Screen Shot 2022-06-09 at 1 50 10 PM

select框,button的颜色都受到了影响

PS: 在app.ts文件里面 引入antd样式相关的代码: import 'antd/dist/antd.dark.less';

wangzongming commented 2 years ago

用的哪个版本的 qnn-react-cron?

yuxuejiao commented 2 years ago

用的哪个版本的 qnn-react-cron?

"qnn-react-cron": "^0.8.6"

wangzongming commented 2 years ago

引入 import "antd/dist/antd.dark.css"; 试下呢? 引入 less 文件不确实你那里有没有更改 antd 那个按需加载的 webpack 配置

yuxuejiao commented 2 years ago

import "antd/dist/antd.dark.css";

试了还是一样的

wangzongming commented 2 years ago

我这里是正常的。 image

webpack 配置在 babel-loader 中增加插件

[
"import",
{
    libraryName: "antd",
    libraryDirectory: "es",
    style: "css",
},
"ant",
],

app.ts 中引入 import "antd/dist/antd.dark.css";

最后设置一个样式

.qnn-react-cron {
    background-color: #000;
}