Created
February 9, 2020 18:15
-
-
Save Tusko/3be9168eb147ecccf1247e89da2bb0e4 to your computer and use it in GitHub Desktop.
Vue Router async push method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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