diff --git a/README.md b/README.md index 7b973d9..19916a5 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ export default { In main.ts, you need to add a few lines to import the generated code and setup the layouts. +## vue-router ```js import { createRouter } from 'vue-router' import { setupLayouts } from 'virtual:generated-layouts' @@ -59,6 +60,17 @@ const router = createRouter({ }); ``` +## [unplugin-vue-router](https://github.com/posva/unplugin-vue-router) +```js +import { createRouter } from 'vue-router/auto' +import { setupLayouts } from 'virtual:generated-layouts' + +const router = createRouter({ + // ... + extendRoutes: (routes) => setupLayouts(routes), +}) +``` + ## Client Types If you want type definition of `virtual:generated-layouts`, add `vite-plugin-vue-layouts/client` to `compilerOptions.types` of your `tsconfig`: ```json