Skip to main content

Extract Repeating Menus as Main Layout

Premium
4 min read

Let's start talking about layouts. Our current main problem is duplication of the menu code for Posts and About pages.


Main Layout: Vue Component

First, we need a Vue component as the main layout. We will create a new folder resources/js/Layouts and a Vue component, App.vue inside it.

Move the repeating code from the Posts/Index.vue and About.vue Vue components to...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

MimisK avatar

Either with only vue.js, or with inertia.js together, is there a way to load specific styles or scripts in a single view?

For example, with the blade there is @stack, @push.

There is a way;

thnx