We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15718a8 commit 9459583Copy full SHA for 9459583
src/router/index.ts
@@ -1,5 +1,5 @@
1
import { createRouter, createWebHistory } from 'vue-router/auto'
2
-import { routes } from 'vue-router/auto-routes'
+import { routes, handleHotUpdate } from 'vue-router/auto-routes'
3
4
import NProgress from 'nprogress'
5
import 'nprogress/nprogress.css'
@@ -15,6 +15,11 @@ const router = createRouter({
15
routes,
16
})
17
18
+// This will update routes at runtime without reloading the page
19
+if (import.meta.hot) {
20
+ handleHotUpdate(router)
21
+}
22
+
23
router.beforeEach((to: EnhancedRouteLocation, from, next) => {
24
NProgress.start()
25
0 commit comments