defineNuxtComponent doesn't support layout property
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.17.1
- Nuxt Version:
3.0.0-rc.13
- Nitro Version:
0.6.1
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
ssr
,build
,modules
,buildModules
- Runtime Modules:
@formkit/nuxt@1.0.0-beta.11
- Build Modules:
@nuxtjs/tailwindcss@6.1.3
,@nuxtjs/eslint-module@3.1.0
Reproduction
Try using different layout on the page:
<script lang="ts">
export default defineNuxtComponent({
layout: 'admin',
})
</script>
Describe the bug
Hi, I’m migrating the project on options API to Nuxt 3, and looks like layout
option doesn’t work when using options API.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Layouts directory - Nuxt
Every file (top-level) in the layouts directory will create a custom layout accessible with the layout property in the page components. Let's say...
Read more >Nuxt.js default layout not being applied - Stack Overflow
I'm brand new to using Nuxt.js, and having an issue: When I created my project, the layouts folder wasn't generated automatically as documented ......
Read more >layouts/ · Nuxt Directory Structure
Unlike other components, your layouts must have a single root element to allow Nuxt to apply transitions between layout changes - and this...
Read more >Views - NuxtJS
Info: Make sure to add the <nuxt/> component when creating a layout to ... a custom layout accessible with the layout property in...
Read more >Views - Nuxt.js
Every file (top-level) in the layouts directory will create a custom layout accessible with the layout property in the page components. Let's say...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The current difference is support for Options API-style
asyncData
: see https://v3.nuxtjs.org/api/utils/define-nuxt-component.Try this:
A PR to improve docs would be welcome 🙏