nuxt下ant-design自定义主题样式

2019-05-23  本文已影响0人  8589068464bc

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
上一篇下一篇

猜你喜欢

热点阅读