-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't access vuex modules #39
Comments
Hi! It is not implemented yet. So you cannot use Vuex modules |
Ohh, I'm sorry. You able to get the data from the modules... See the example: Your store (from your example) export default new Vuex.Store({
modules: {
reading: {
state: {}, // ....
mutations: {},
actions
},
filetree: {
state: {
treeData: []
},
mutations = {
initTree(state, treeData) {
state.treeData.push(...treeData)
},
updateTree(state, newData) {
state.treeData = newData
}
}
}
},
getters: {
tree(state) {
return state.filetree.tree // reads 'tree' state from `filetree` module
}
},
strict: process.env.NODE_ENV !== 'production'
})
treeOptions: {
paddingLeft: 10,
store: {
store: this.$store,
getter: 'tree', // ~~~ use `getter` instead of `key`
mutations: ['initTree', 'updateTree']
}
} |
@amsik thanks for your demo! btw, a quotation mark is missing in vuex document page line 21. Cool tree display tool! |
Hi,
I'm integrating this tool with Vuex, and have the following problem.
According to the documents, integrated with Vuex should pass Vuex store object into
treeOptions
The file tree looks like this (see also github repo)
When I create several modules, the states of each modules are separated but the mutations are mixed. It seems unable to get a Vuex store object.
In my understanding, this plugin will copy the reference of its data into Vuex state in
initTree
mutation. Can I pass only listened state property and some actions(or mutations) intotree options
? So that I can visit the required objects from Vue file viamapState
,mapActions
andmapMutations
.The text was updated successfully, but these errors were encountered: