Skip to content

Instantly share code, notes, and snippets.

@Tusko
Created February 9, 2020 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tusko/3be9168eb147ecccf1247e89da2bb0e4 to your computer and use it in GitHub Desktop.
Save Tusko/3be9168eb147ecccf1247e89da2bb0e4 to your computer and use it in GitHub Desktop.
Vue Router async push method
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
routes
});
/**
* Async push method
*/
router.pushAsync = function(route) {
return new Promise((resolve, reject) => {
router.push(route, resolve, reject);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment