no message

Former-commit-id: 77dbdfa7f01c725b08ba78a4c8e3361beeed5508
Former-commit-id: a3dd25ef792dfd2f361ed45f1526b2ee2d8bc0a6
Former-commit-id: 5d1d40f8267f4c6d91ee07042d53f0204c3754ce
This commit is contained in:
liyang
2018-06-11 21:01:00 +08:00
parent 5ecc2c53eb
commit fb2404fe76
2 changed files with 19 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
import Cookies from 'js-cookie'
export default {
state: {
list: [
@@ -15,6 +17,14 @@ export default {
name: 'star'
},
mutations: {
loadTheme (state) {
const name = Cookies.get('themeName')
if (name) {
this.commit('setTheme', name)
} else {
this.commit('setTheme', state.list[0].value)
}
},
// 设置主题
setTheme (state, name) {
state.name = name