Support the ongoing development of →
Jetstream Vue.js Laravel
Last updated by @novica89 1 year ago.

Never mind, seems like you can just use regular options API approach straight away instead of composition. The only thing is: You have to import "Layout" component(s) inside of the <script setup></script> tags and can't do it the "usual" way by importing in the regular script tags (where you define component object, import other components that you might be using etc). So, an example of the default "Dashboard" component in Inertia but re-written in Options API would be this:

    <AppLayout title="Dashboard">
        <template #header>
            <h2 class="font-semibold text-xl text-gray-800 leading-tight">
                {{ title }}

        <div class="py-12">
            <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
                <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
                    {{ content }}
                    <Welcome />


<script setup>
// Layout's HAVE TO be imported in the script setup
import AppLayout from '@/Layouts/AppLayout.vue';

// Other components used can just be imported the usual way
import Welcome from '@/Components/Welcome.vue';

export default {
    // I directly send properties from backend and they get populated in as props
    props: {
        title: String,
        content: String

If anyone knows the way around having to import layout file in the setup script tag, let me know.

Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

Novica novica89 Joined 15 Feb 2023


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.