--- name: inertia-vue-development description: "Develops Inertia.js v1 Vue client-side applications. Activates when creating Vue pages, forms, or navigation; using Link or router; or when user mentions Vue with Inertia, Vue pages, Vue forms, or Vue navigation." license: MIT metadata: author: laravel --- @php /** @var \Laravel\Boost\Install\GuidelineAssist $assist */ @endphp # Inertia Vue development ## Documentation Use `search-docs` for detailed Inertia v1 Vue patterns and documentation. ## Basic usage ### Page components location Place Vue page components in the `{{ $assist->inertia()->pagesDirectory() }}` directory. ### Page component structure Important: Vue components must have a single root element. @verbatim @boostsnippet("Basic Vue Page Component", "vue") @endboostsnippet @endverbatim ## Client-side navigation ### Basic Link component Use `` for client-side navigation instead of `` tags: @boostsnippet("Inertia Vue Navigation", "vue") @endboostsnippet ### Link with method @boostsnippet("Link With POST Method", "vue") @endboostsnippet ### Programmatic navigation @boostsnippet("Router Visit", "vue") @endboostsnippet ## Form handling ### Using `router.post` @boostsnippet("Form with router.post", "vue") @endboostsnippet ## Inertia v1 limitations Inertia v1 does not support these v2 features: - `
` component - Deferred props - Prefetching - Polling - Infinite scrolling with `WhenVisible` - Merging props Do not use these features in v1 projects. ## Server-side patterns The inertia-laravel guidelines cover server-side patterns such as Inertia::render, props, and middleware. ## Common pitfalls - Using traditional `` links instead of Inertia's `` component (breaks SPA behavior) - Using multiple root elements in Vue components (Vue 3 supports multiple roots, but a single root is recommended for Inertia v1 compatibility) - Using Inertia v2 features, such as deferred props or the `` component, in v1 projects - Using `` without preventing default submission (use `@submit.prevent`) - Not handling loading states during form submission