From cdcd1aaff09ad9cca9cd8c0444071abb778b9e29 Mon Sep 17 00:00:00 2001 From: Pranay Aryal Date: Thu, 19 Nov 2020 21:32:57 -0500 Subject: [PATCH] Update introduction.md --- 1.x/introduction.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/1.x/introduction.md b/1.x/introduction.md index 888e1d1..a6caee5 100644 --- a/1.x/introduction.md +++ b/1.x/introduction.md @@ -27,7 +27,34 @@ If you're new to Livewire, check out the [screencasts available on the Livewire ### Inertia.js + Vue -The Inertia.js stack provided by Jetstream uses [Vue.js](https://vuejs.org) as its templating language. Building an Inertia application is a lot like building a typical Vue application; however, you will use Laravel's router instead of Vue router. Inertia is a small library that allows you to render single-file Vue components from your Laravel backend by providing the name of the component and the data that should be hydrated into that component's "props". +The Inertia.js stack provided by Jetstream uses [Vue.js](https://vuejs.org) as its templating language. Building an Inertia application is a lot like building a typical Vue application; however, you will use Laravel's router instead of Vue router. Inertia is a small library that allows you to render single-file Vue components from your Laravel backend by providing the name of the component and the data that should be hydrated into that component's "props" like this. + +```{js} +Route::middleware(['auth:sanctum', 'verified'])->get('/edit', function () { + return Inertia\Inertia::render('Edit', [ + 'testing_props' => 'This is prop testing' + ]); +})->name('edit'); +``` +Then in your Vue page (Edit.vue) you can do like this: + +```{js} + + + +``` In other words, this stack gives you the full power of Vue.js without the complexity of client-side routing. You get to use the standard Laravel router that you are used to.