layout feature doesn't work
mamboer opened this issue · comments
Describe the bug
Sub-pages always use the ‘default’ layout, even if a different layout name is set in the meta.
Reproduction:
- Checkout the code of the main branch from https://github.com/antfu/vitesse
- Add a
test.vue
layout in thesrc/layouts/
folder
<template>
<h1>Test Layout</h1>
<RouterView />
</template>
- Add a test page
src/pages/test/index.vue
, and specifed it's layout totest
<template>
<h1>Test Title</h1>
</template>
<route lang="yaml">
meta:
layout: test
</route>
- Run the app via
pnpm i && pnpm dev
- Visit
http://localhost:3333/test/
in the browser - Comfirm that the test page doesn't use the test layout
Reproduction project
https://github.com/mamboer/vitesse
Just checkout the code and run it.
Reproduction
https://github.com/mamboer/vitesse
System Info
System:
OS: macOS 14.1.2
CPU: (8) arm64 Apple M2
Memory: 97.30 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
pnpm: 8.11.0 - /Volumes/Pluto/dev/github/mamboer/vitesse/node_modules/.bin/pnpm
Browsers:
Chrome: 119.0.6045.199
Safari: 17.1.2
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
This is an issue in vite-plugin-vue-layouts:
JohnCampionJr/vite-plugin-vue-layouts#120
I'm working on it; hope to have an update in the next day or two.
I have released 0.9.0, it should fix this.
Nice job 👍