0

I'm relatively new to Laraval and VUE and I got stuck with blade @section that gives me strange behaviour. When I move my view component inside a @section it is no longer showing up. Hello test1 is displaying with VUE component but Hello test2 is displaying but not the VUE component.

@extends('layout')

{{--test1--}}
<h1>Hello test1 </h1>
<div id="app">
    <example-component></example-component>
</div>

{{--test2--}}
@section('content')
    <h1>Hello test2</h1>
    <div id="app">
        <example-component></example-component>
    </div>
@endsection

I saw here: How to Install Vue.js in Laravel 8 step 5 that I should add id="app" to my layout file not sure how to implement that.

user1738671
  • 77
  • 1
  • 8
  • you should have a @yield('content') on your basic html view in order to inject @section('content') – Farid Nov 10 '22 at 19:06
  • I do this is why Hello test2 is showing up – user1738671 Nov 10 '22 at 19:11
  • @user1738671 Vue Component are different, they are not like normal html. – STA Nov 11 '22 at 04:46
  • Please add code and data as text ([using code formatting](//stackoverflow.com/editing-help#code)), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and [many more reasons](//meta.stackoverflow.com/a/285557). Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data. – cigien Nov 11 '22 at 05:02

0 Answers0