How To Import Router !! #460
Unanswered
khaledOghli
asked this question in
Q&A
Replies: 2 comments
-
if could you help me please @antfu |
Beta Was this translation helpful? Give feedback.
0 replies
-
maybe it's not the best way ,but this what i did :
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Guys
Please if someone help me how to import router to make router.push(path) from api.js
I'm not able to figure out how to make it.
my example : where need to import router.
APIWrapper.js
api.interceptors.response.use(null, error => { let path = '/error'; switch (error.response.status) { case 401: path = '/login'; break; case 404: path = '/404'; break; } router.push(path); return Promise.reject(error); });
Many Thanks.
Beta Was this translation helpful? Give feedback.
All reactions