feature: change page title when route change (#1910)

This commit is contained in:
非空
2019-04-15 11:58:43 +08:00
committed by 花裤衩
parent 14580da5b3
commit 26d0f40df2
6 changed files with 37 additions and 10 deletions

View File

@@ -11,16 +11,26 @@
const version = require('element-ui/package.json').version // element-ui version from node_modules
const ORIGINAL_THEME = '#409EFF' // default color
import defaultSettings from '@/settings'
export default {
data() {
return {
chalk: '', // content of theme-chalk css
theme: defaultSettings.theme
theme: ''
}
},
computed: {
defaultTheme() {
return this.$store.state.settings.theme
}
},
watch: {
defaultTheme: {
handler: function(val, oldVal) {
this.theme = val
},
immediate: true
},
async theme(val) {
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
if (typeof val !== 'string') return