Skip to content

Commit

Permalink
fix: menu-nav theme replace space class
Browse files Browse the repository at this point in the history
- update vue.config.js
  • Loading branch information
sendya committed Nov 25, 2019
1 parent 8c0e6dd commit 2c72fdd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
3 changes: 3 additions & 0 deletions config/plugin.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 12 additions & 19 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: {
Expand All @@ -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) => {
Expand All @@ -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
Expand All @@ -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
}
}
Expand Down

0 comments on commit 2c72fdd

Please sign in to comment.