diff --git a/src/mixins/color.js b/src/mixins/color.js index dd58013..f7cd2c0 100644 --- a/src/mixins/color.js +++ b/src/mixins/color.js @@ -12,12 +12,21 @@ export default function() { themeVal(val, oldVal) { console.log(val, oldVal) this.$store.commit('SET_THEME', val) + document.documentElement.style.setProperty(`--theme`, val); this.updateTheme(val, oldVal) } }, computed: { ...mapGetters(['theme']) }, + + created() { + // 修改主题色 + if (this.$domain == 'localhost') { + this.themeVal = '#FF4500' + } + }, + methods: { updateTheme(val, oldVal) { if (typeof val !== 'string') return diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue index 09eb9de..739d3f0 100644 --- a/src/page/index/logo.vue +++ b/src/page/index/logo.vue @@ -1,89 +1,121 @@ + diff --git a/src/page/index/sidebar/sidebarItem.vue b/src/page/index/sidebar/sidebarItem.vue index 246381b..33369be 100644 --- a/src/page/index/sidebar/sidebarItem.vue +++ b/src/page/index/sidebar/sidebarItem.vue @@ -131,3 +131,46 @@ export default { }; + \ No newline at end of file diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue index def4bfe..3921f62 100644 --- a/src/page/index/top/index.vue +++ b/src/page/index/top/index.vue @@ -1,14 +1,5 @@