feat: save page
This commit is contained in:
@@ -1,28 +1,32 @@
|
||||
import _ from 'lodash'
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import pathify from 'vuex-pathify'
|
||||
import pathify from 'vuex-pathify' // eslint-disable-line import/no-duplicates
|
||||
import { make } from 'vuex-pathify' // eslint-disable-line import/no-duplicates
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
const state = {
|
||||
loadingStack: [],
|
||||
notification: {
|
||||
message: '',
|
||||
style: 'primary',
|
||||
icon: 'cached',
|
||||
isActive: false
|
||||
}
|
||||
}
|
||||
|
||||
export default new Vuex.Store({
|
||||
strict: process.env.NODE_ENV !== 'production',
|
||||
plugins: [
|
||||
pathify.plugin
|
||||
],
|
||||
state: {
|
||||
loadingStack: [],
|
||||
notification: {
|
||||
message: '',
|
||||
style: 'primary',
|
||||
icon: 'cached',
|
||||
isActive: false
|
||||
}
|
||||
},
|
||||
state,
|
||||
getters: {
|
||||
isLoading: state => { return state.loadingStack.length > 0 }
|
||||
},
|
||||
mutations: {
|
||||
...make.mutations(state),
|
||||
loadingStart (state, stackName) {
|
||||
state.loadingStack = _.union(state.loadingStack, [stackName])
|
||||
},
|
||||
|
Reference in New Issue
Block a user