Chore: add theme (#15361)

This commit is contained in:
iamkun
2019-04-30 17:52:18 +08:00
committed by hetech
parent fa18e93238
commit 2bd5098b83
7 changed files with 48 additions and 30 deletions

View File

@@ -303,7 +303,7 @@
</li>
<li
class="nav-item"
v-if="showThemeConfigurator"
v-if="$isEle"
>
<router-link
active-class="active"
@@ -373,7 +373,7 @@
<!--theme picker-->
<li class="nav-item nav-theme-switch" v-show="isComponentPage">
<theme-picker v-if="!showThemeConfigurator"></theme-picker>
<theme-picker v-if="!$isEle"></theme-picker>
</li>
</ul>
</div>
@@ -405,8 +405,7 @@
'en-US': 'English',
'es': 'Español',
'fr-FR': 'Français'
},
showThemeConfigurator: false
}
};
},
@@ -432,18 +431,14 @@
}
},
mounted() {
const host = location.hostname;
this.showThemeConfigurator = host.match('localhost') || host.match('elenet');
if (!this.showThemeConfigurator) {
getVars()
.then(() => {
this.showThemeConfigurator = true;
ga('send', 'event', 'DocView', 'Inner');
})
.catch((err) => {
console.error(err);
});
}
getVars()
.then(() => {
this.$isEle = true;
ga('send', 'event', 'DocView', 'Inner');
})
.catch((err) => {
console.error(err);
});
},
methods: {
switchVersion(version) {