add test.
This commit is contained in:
62
test/dashboard2/src/store.js
Normal file
62
test/dashboard2/src/store.js
Normal file
@@ -0,0 +1,62 @@
|
||||
export default {
|
||||
modules: {
|
||||
navigator: {
|
||||
strict: true,
|
||||
namespaced: true,
|
||||
state: {
|
||||
stack: [],
|
||||
options: {}
|
||||
},
|
||||
mutations: {
|
||||
push (state, page) {
|
||||
state.stack.push(page)
|
||||
},
|
||||
pop (state) {
|
||||
if (state.stack.length > 1) {
|
||||
state.stack.pop()
|
||||
}
|
||||
},
|
||||
replace (state, page) {
|
||||
state.stack.pop()
|
||||
state.stack.push(page)
|
||||
},
|
||||
reset (state, page) {
|
||||
state.stack = [page || state.stack[0]]
|
||||
},
|
||||
options (state, newOptions = {}) {
|
||||
state.options = newOptions
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
splitter: {
|
||||
strict: true,
|
||||
namespaced: true,
|
||||
state: {
|
||||
open: false
|
||||
},
|
||||
mutations: {
|
||||
toggle (state, shouldOpen) {
|
||||
if (shouldOpen instanceof Boolean) {
|
||||
state.open = shouldOpen
|
||||
} else {
|
||||
state.open = !state.open
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
tabbar: {
|
||||
strict: true,
|
||||
namespaced: true,
|
||||
state: {
|
||||
index: 0
|
||||
},
|
||||
mutations: {
|
||||
set (state, index) {
|
||||
state.index = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user