question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Doc] Use layouts with `<script setup>`

See original GitHub issue

The doc is not very clear. https://v3.nuxtjs.org/docs/directory-structure/layouts There should probably be an exemple for both <script setup> and the options API for every Nuxt feature. I’d think I’d have to use the new <NuxtLayout> component, but the it says you have to disable something using the option API.

<script>
export default {
  layout: false,
};
</script>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
huynl-96commented, Oct 13, 2021

I think you misunderstand the functionality of <script setup>. This is just another way to express the setup() function in Vue 3. Just simply combine <script setup> with normal <script> (for any additional component options).

e.g.:

<script>
export default {
  layout: false,
  inheritAttrs: false,
  ...
};
</script>

<script setup>
// your setup script
</script>

You can look more into this in the below link https://v3.vuejs.org/api/sfc-script-setup.html#usage-alongside-normal-script

1reaction
mrleblanc101commented, Oct 14, 2021

I think the doc should be more clear about that, a lot of people will switch from Vue 2 to Vue 3 when Nuxt 3 launch and it might be complicated to constantly switch doc. Maybe put a reference to the Vue 3 doc when applicable ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

<script setup> | Vue.js
<script setup> is a compile-time syntactic sugar for using Composition API inside Single-File Components (SFCs). It is the recommended syntax if you are ......
Read more >
How to set persistent layout in <script setup>? #1164 - GitHub
This currently the best way to manually set layouts using the <script setup>. If however, you want to set the layout automatically by...
Read more >
Customize window layouts and personalize document tabs
Learn how to customize tabs and windows in Visual Studio to create layouts that work best for your development workflows.
Read more >
Using layout property in <script setup> tag - Stack Overflow
Is there any way to use layout property of ...
Read more >
Lesson #5: Layout Mode & Design - Layout Script Triggers
When you're working in FileMaker's Layout Mode, you're likely in the process of designing how users will interact with your solution's data.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found