vue-cli3.0 configure Iview custom theme


don’t panic, followIviewCome on, probably . . . no problem!

1. Create a new my-them.less

@import '~view-design/src/styles/index.less';

/*Theme configuration and other configurations refer to*/
@primary-color: #6C86FF;
@link-hover-color: #6C86FF;

2. Import the entry file main.js

import './assets/css/my-them.less';


  • The less file needs to be supported here, and the project should install less and less-loader
// cannot exceed the next two version numbers below
npm install [email protected] [email protected] -D
  • vue.config.js configuration
module.exports = {
        // css presetter configuration item
        loaderOptions: {
            less: {
                javascriptEnabled: true