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 007337a commit 3f44b15Copy full SHA for 3f44b15
src/vue-router.common.ts
@@ -33,10 +33,10 @@ export const createRouter = (
33
});
34
35
// Vue 3 compatibility
36
- if (proto.config && proto.config.globalProperties) {
37
- proto.config.globalProperties.$routeTo = router.push.bind(router);
38
- proto.config.globalProperties.$routeBack = router.back.bind(router);
39
- proto.config.globalProperties.$router = router;
+ if (vm.createApp && vm.config.globalProperties) {
+ vm.config.globalProperties.$routeTo = router.push.bind(router);
+ vm.config.globalProperties.$routeBack = router.back.bind(router);
+ vm.config.globalProperties.$router = router;
40
} else {
41
proto.$routeTo = router.push.bind(router);
42
proto.$routeBack = router.back.bind(router);
0 commit comments