feat: editor page properties

This commit is contained in:
NGPixel
2018-07-15 19:16:19 -04:00
parent fd8bf4dbff
commit 760939f808
11 changed files with 232 additions and 98 deletions

View File

@@ -49,6 +49,7 @@
<script>
import _ from 'lodash'
import { sync } from 'vuex-pathify'
import themeSaveMutation from 'gql/admin/theme/theme-mutation-save.gql'
@@ -60,21 +61,17 @@ export default {
{ text: 'Default', author: 'requarks.io', value: 'default' }
],
selectedTheme: 'default',
darkMode: false,
darkModeInitial: false
}
},
watch: {
darkMode(newValue, oldValue) {
this.$store.commit('admin/setThemeDarkMode', newValue)
}
computed: {
darkMode: sync('admin/theme@dark')
},
mounted() {
this.darkMode = this.$store.state.admin.theme.dark
this.darkModeInitial = this.darkMode
},
beforeDestroy() {
this.$store.commit('admin/setThemeDarkMode', this.darkModeInitial)
this.darkMode = this.darkModeInitial
},
methods: {
async save () {