-
Notifications
You must be signed in to change notification settings - Fork 161
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
Could I use this out of Vue Component? #60
Comments
@thearabbit Haven't tested it but you could do something like this: import VueProgressBar from 'vue-progressbar'
Vue.use(VueProgressBar )
Meteor.startup(() => {
// Start the vue app
const app = new Vue({
store,
...AppLayout,
}).$mount('app')
// Before each
app.$router.beforeEach((to, from, next) => {
app.$Progress.start()
if (!to.meta.notRequiresAuth) {
// Check user
if (!Meteor.loggingIn() && !Meteor.userId()) {
next({ path: '/login' })
} else {
next()
}
} else {
next()
}
})
// // After each
app.$router.afterEach((to, from) => {
app.$Progress.finish()
})
}) |
Thank for your reply, I will try soon |
It work for |
Have any solve? |
Waiting... |
Is your authentication a route change within Vue, or do you only initialize Vue itself after the user has logged in? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I base on
Meteor
.I check
Progressbar on Meteor Startup
Bc I use check
router hook
inApp Layout
don't workThe text was updated successfully, but these errors were encountered: