Refactor store management
This commit is contained in:
parent
8e49d0e0f2
commit
5ba15f8850
@ -20,10 +20,10 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$store.getters.ui.title;
|
||||
return this.$store.state.ui.title;
|
||||
},
|
||||
backgroundColor() {
|
||||
return this.$store.getters.ui.backgroundColor;
|
||||
return this.$store.state.ui.backgroundColor;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
<script>
|
||||
/**
|
||||
* TODO: Do not open drawer on route change.
|
||||
* TODO: Do not open drawer on route change nor on resize.
|
||||
* TODO: Should stick to the toolbar on xs screens. Should be fixed by Vuetify 0.16.
|
||||
*/
|
||||
export default {
|
||||
|
@ -1,6 +0,0 @@
|
||||
// TODO: Shouldn't we use mapState/mapGetters?
|
||||
export default {
|
||||
product: state => state.product,
|
||||
isLoading: state => state.isLoading,
|
||||
ui: state => state.ui,
|
||||
};
|
@ -1,9 +1,7 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import createLogger from 'vuex/dist/logger'; // TODO
|
||||
|
||||
import actions from './actions';
|
||||
import getters from './getters';
|
||||
import { initialState as state, mutations } from './mutations';
|
||||
|
||||
Vue.use(Vuex);
|
||||
@ -11,7 +9,5 @@ Vue.use(Vuex);
|
||||
export default new Vuex.Store({
|
||||
state,
|
||||
actions,
|
||||
getters,
|
||||
mutations,
|
||||
plugins: [createLogger()],
|
||||
});
|
||||
|
@ -67,12 +67,12 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
product() {
|
||||
const product = this.$store.getters.product;
|
||||
const product = this.$store.state.product;
|
||||
this.$store.dispatch('setTitle', { title: product.product_name });
|
||||
return product;
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.getters.isLoading;
|
||||
return this.$store.state.isLoading;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
Loading…
Reference in New Issue
Block a user