安装依赖并添加至 package.json
# antd
$ npm i -S antd
添加 antd
插件和 theme
配置
{
...
+ "theme": "antd.config.js",
"env": {
"development": {
"extraBabelPlugins": [
...
+ [ "import", { "libraryName": "antd", "style": true } ]
]
},
"production": {
"extraBabelPlugins": [
...
+ [ "import", { "libraryName": "antd", "style": true } ]
]
}
},
...
}
antd
主题相关配置
相关文档参考 https://ant.design/docs/react/customize-theme-cn 不支持
es6
const path = require( 'path' );
module.exports = {
// antd 自带图标字体本地化
'icon-url': `"${path.relative( './~/antd/lib/style/*', './src/assets/fonts/iconfont' )}"`
};
复制字体文件到 ./src/assets/fonts/
文件夹