1

.webpackrc.js,有错吗?

当我import {Select} from antd的 Select 没有风格,只是 antd-mobile 风格的作品。

entry: "src/index.js", 
theme: 'src/theme.js',
extraBabelPlugins: [[
  "import",
  {libraryName: "antd-mobile", 
  "libraryDirectory": "lib", "style":true}, 
  {libraryName: "antd",
  "libraryDirectory": "lib", "style": true} 
]],
4

2 回答 2

0

确保你写了正确的组件Select,以大写字母开头。或尝试其他组件,看看是否相同?

于 2019-06-23T12:50:29.233 回答
0

尝试通过添加手动导入 css

import 'antd/dist/antd.css';或者import 'antd/dist/antd.less'

来源:https ://ant.design/docs/react/introduce

于 2021-04-22T00:23:40.003 回答