-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
278 additions
and
70 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Generated by 'unplugin-auto-import' | ||
export {} | ||
declare global { | ||
const defineLoader: typeof import('unplugin-vue-router/runtime')['_defineLoader'] | ||
const defineLoader: typeof import('@vue-router')['defineLoader'] | ||
const useRoute: typeof import('@vue-router')['useRoute'] | ||
const useRouter: typeof import('@vue-router')['useRouter'] | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// NOTE: this code needs to be generated because otherwise it doesn't go through transforms and `@vue-router/routes` | ||
// cannot be resolved. | ||
export function generateVueRouterProxy(routesModule: string) { | ||
return ` | ||
import { routes } from '${routesModule}' | ||
import { createRouter as _createRouter } from 'vue-router' | ||
import { | ||
_setupDataFetchingGuard, | ||
} from 'unplugin-vue-router/runtime' | ||
export * from 'vue-router' | ||
export { | ||
_defineLoader as defineLoader, | ||
} from 'unplugin-vue-router/runtime' | ||
export function createRouter(options) { | ||
const { extendRoutes } = options | ||
// use Object.assign for better browser support | ||
const router = _createRouter(Object.assign( | ||
options, | ||
{ routes: typeof extendRoutes === 'function' ? extendRoutes(routes) : routes }, | ||
)) | ||
_setupDataFetchingGuard(router) | ||
return router | ||
} | ||
` | ||
} |
Oops, something went wrong.