-
Notifications
You must be signed in to change notification settings - Fork 125
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
How to access store
in beforeEnter
#26
Comments
Just import the store. |
It will create a new store... // My store/index.js
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {},
modules: { .... }
})
export default store It recommended import again? |
No it won't. |
Is it possible to access store data in beforeEnter which is retrieved asynchronously in the store action? This is especially important after a page reload, when some init data is being fetched and the router needs to wait for that data to either allow the user to access that page or not. Is it possible for the router to "wait" for the data to be fetched? |
This is a closed ticket, and a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide). We encourage you to ask it on the forum , Stack Overflow or on gitter and are happy to help you out there. |
Okay, okay ;) Just thought it might come in handy to ask it right here since other users will be directed here from Google with the same question... but I'll ask on SO :) Sorry, Linus! Just for completion and future reference in case someone stumbles upon this question. I asked it here on SO: http://stackoverflow.com/questions/42579601/how-to-access-async-store-data-in-vue-router-for-usage-in-beforeenter-hook |
No problem, it's just rules are rules and issues have to stay manageable ;) |
How can I start some animation on the parent component from |
Please use forum.vuejs.org for questions. |
This is pure gold. |
Yeah but enough comedy for now. :) |
How access store in beforeEnter ?
The text was updated successfully, but these errors were encountered: