Browse Source

fix: menu-nav theme replace space class
- update vue.config.js

Sendya 5 years ago
parent
commit
2c72fddd68
2 changed files with 15 additions and 19 deletions
  1. 3 0
      config/plugin.config.js
  2. 12 19
      vue.config.js

+ 3 - 0
config/plugin.config.js

@@ -24,13 +24,16 @@ const themePluginOption = {
       case '.ant-btn.active,.ant-btn:active':
         return '.ant-btn.active:not(.ant-btn-primary):not(.ant-btn-danger),.ant-btn:active:not(.ant-btn-primary):not(.ant-btn-danger)'
       case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon':
+      case '.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon':
         return ':not(.ant-steps-item-process)' + selector
       case '.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item-open,.ant-menu-horizontal>.ant-menu-item-selected,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu-active,.ant-menu-horizontal>.ant-menu-submenu-open,.ant-menu-horizontal>.ant-menu-submenu-selected,.ant-menu-horizontal>.ant-menu-submenu:hover':
       case '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal > .ant-menu-submenu-selected,.ant-menu-horizontal > .ant-menu-submenu:hover':
         return '.ant-menu-horizontal > .ant-menu-item-active,.ant-menu-horizontal > .ant-menu-item-open,.ant-menu-horizontal > .ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-item:hover,.ant-menu-horizontal > .ant-menu-submenu-active,.ant-menu-horizontal > .ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-submenu:hover'
       case '.ant-menu-horizontal > .ant-menu-item-selected > a':
+      case '.ant-menu-horizontal>.ant-menu-item-selected>a':
         return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item-selected > a'
       case '.ant-menu-horizontal > .ant-menu-item > a:hover':
+      case '.ant-menu-horizontal>.ant-menu-item>a:hover':
         return '.ant-menu-horizontal:not(ant-menu-light):not(.ant-menu-dark) > .ant-menu-item > a:hover'
       default :
         return selector

+ 12 - 19
vue.config.js

@@ -6,15 +6,16 @@ function resolve (dir) {
   return path.join(__dirname, dir)
 }
 
-/**
- * check production or preview(pro.loacg.com only)
- * @returns {boolean}
- */
-function isProd () {
-  return process.env.NODE_ENV === 'production'
-}
+const isProd = process.env.NODE_ENV === 'production'
 
 const assetsCDN = {
+  // webpack build externals
+  externals: {
+    vue: 'Vue',
+    'vue-router': 'VueRouter',
+    vuex: 'Vuex',
+    axios: 'axios'
+  },
   css: [],
   // https://unpkg.com/browse/vue@2.6.10/
   js: [
@@ -25,14 +26,6 @@ const assetsCDN = {
   ]
 }
 
-// webpack build externals
-const prodExternals = {
-  vue: 'Vue',
-  'vue-router': 'VueRouter',
-  vuex: 'Vuex',
-  axios: 'axios'
-}
-
 // vue.config.js
 const vueConfig = {
   configureWebpack: {
@@ -41,8 +34,8 @@ const vueConfig = {
       // Ignore all locale files of moment.js
       new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
     ],
-    // if prod is on, add externals
-    externals: isProd() ? prodExternals : {}
+    // if prod, add externals
+    externals: isProd ? assetsCDN.externals : {}
   },
 
   chainWebpack: (config) => {
@@ -67,7 +60,7 @@ const vueConfig = {
 
     // if prod is on
     // assets require on cdn
-    if (isProd()) {
+    if (isProd) {
       config.plugin('html').tap(args => {
         args[0].cdn = assetsCDN
         return args
@@ -85,7 +78,7 @@ const vueConfig = {
           // 'link-color': '#F5222D',
           // 'border-radius-base': '4px'
         },
-        // do not remove this line
+        // DO NOT REMOVE THIS LINE
         javascriptEnabled: true
       }
     }