nafeeur10
277
7
Vue

Two Components in View: Laravel

Posted 3 months ago by nafeeur10

Is it possible to use multiple Components in blade?

I want to divide my code into three sections.

  1. Header
  2. Main
  3. Footer

I want to keep them into root blade like home.blade.php

app.js

Vue.component('app-header', require('./components/front/common/AppHeader.vue').default);
Vue.component('app-login', require('./components/auth/Login.vue'));


const app = new Vue({
    el: '#app'
});

home.blade.php

<div id="app">
        <app-header></app-header>
        <app-login></app-login>
</div>

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.