mirror of https://github.com/ElemeFE/element
chore: better show theme (#14557)
parent
608f1ba33f
commit
f872b6d8c8
|
@ -378,6 +378,7 @@
|
||||||
import AlgoliaSearch from './search.vue';
|
import AlgoliaSearch from './search.vue';
|
||||||
import compoLang from '../i18n/component.json';
|
import compoLang from '../i18n/component.json';
|
||||||
import Element from 'main/index.js';
|
import Element from 'main/index.js';
|
||||||
|
import { getVars } from './theme-configurator/utils/api.js';
|
||||||
import bus from '../bus';
|
import bus from '../bus';
|
||||||
|
|
||||||
const { version } = Element;
|
const { version } = Element;
|
||||||
|
@ -395,7 +396,8 @@
|
||||||
'en-US': 'English',
|
'en-US': 'English',
|
||||||
'es': 'Español',
|
'es': 'Español',
|
||||||
'fr-FR': 'Français'
|
'fr-FR': 'Français'
|
||||||
}
|
},
|
||||||
|
showThemeConfigurator: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -417,13 +419,21 @@
|
||||||
},
|
},
|
||||||
isComponentPage() {
|
isComponentPage() {
|
||||||
return /^component/.test(this.$route.name);
|
return /^component/.test(this.$route.name);
|
||||||
},
|
|
||||||
showThemeConfigurator() {
|
|
||||||
const host = location.hostname;
|
|
||||||
return host.match('localhost') || host.match('elenet');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
const host = location.hostname;
|
||||||
|
this.showThemeConfigurator = host.match('localhost') || host.match('elenet');
|
||||||
|
if (!this.showThemeConfigurator) {
|
||||||
|
getVars()
|
||||||
|
.then(() => {
|
||||||
|
this.showThemeConfigurator = true;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
switchVersion(version) {
|
switchVersion(version) {
|
||||||
if (version === this.version) return;
|
if (version === this.version) return;
|
||||||
|
|
Loading…
Reference in New Issue