Skip to content

Using persistent layouts with composition api and <script setup> tag #481

Answered by rrrrando
rrrrando asked this question in Help (Vue)
Discussion options

You must be logged in to vote

I read the RFC and figured it out. The solution is to just add a normal script tag like so :

//Everything in here will be exposed to template
<script setup>
import Component from './ExampleCompoenent':

const item = "Some Vue stuff";
</script>
// Add a second script tag and export the layout
<script>
export default { layout: BlogLayout }
</script>

<template>
   <p>Some content here! {{ item }}</p>
</template>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rrrrando
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants