App.vue
643 Bytes
<template>
<!-- <div id="app" class="dark-theme white-theme"> -->
<div id="app" :class="{'white-theme':theme=='white','dark-theme':theme=='dark'}">
<router-view/>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'App',
data(){
return {
ctheme:'dark'
}
},
computed:{
...mapState(['theme'])
},
watch: {
theme(val){
this.theme = val
localStorage.setItem('theme',val)
}
},
}
</script>
<style>
#app {
font-family: "微软雅黑",Arial,sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #fff;
}
</style>