Access VueRouter outside Vue components

I’ve used it only from components but you could try following in case you’re using common boilerplate where routes are defined under router/index.js then you just import it like:

import Router from '../router'; 

After it is possible to use it in code e.g.

Router.push('/mypage')

Not sure if it works but give it a try.

Leave a Comment

techhipbettruvabetnorabahisbahis forumu