1 安装 less less-loader
npm install less less-loader -D
2修改nuxt配置文件 nuxt.config.js
把 ant-design-vue/dist/antd.css 改为ant-design-vue/dist/antd.less
/*
** Global CSS
*/
css: ['ant-design-vue/dist/antd.css'],
/*
** Global CSS
*/
css: ['ant-design-vue/dist/antd.less'],
在build-》loaders添加less loader
build: {
/*
** You can extend webpack config here
*/
loaders: {
less: {
javascriptEnabled: true,
modifyVars: {
'primary-color': '#41b883',
'layout-body-background': '#fff'
}
}
}
}
3 重新运行即可
npx nuxt
网友评论