项目根目录下新建文件vue.config.js
// vue.config.js for less-loader@6.0.0
module.exports = {
css: {
loaderOptions: {
less: {
lessOptions: {
// If you are using less-loader@5 please spread the lessOptions to options directly
modifyVars: {
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
'border-radius-base': '2px',
},
javascriptEnabled: true,
},
},
},
},
};
没有生效?
如果你是通过 'ant-design-vue/dist/antd.css'
引入样式的,改为 ant-design-vue/dist/antd.less
最重要的就是vue-cli默认安装的less-loader 是 5.0.0,ant-design-vue要求为6.0.0