Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shweta11's avatar

In Laravel I am trying to render .Vue file inside blade but it is not displayed

Check my code app.js

const app = createApp({});
app.component('test-component', TestComponent);
app.mount('#app'); 

test.blade.php

@extends('layouts.app')

@section('content')
    <div id="app">
        <test-component></test-component>
    </div>
@endsection

TestComponent.vue

<template>
    <div>
      <h2>This is a Test Component</h2>
      <p>Hello from Vue!</p>
    </div>
  </template>
  
  <script>
  export default {
    // Component logic
  };
  </script>
  
  <style scoped>
  /* Component-specific styles */
  </style>
0 likes
1 reply
gych's avatar

Format your code when posting it on the forum. You can do this by adding 3 backticks ``` before and after the code.

Example:

```

YOUR CODE

```

For your issue add the component inside the section

@section('content')
    <test-component></test-component>
@endsection
1 like

Please or to participate in this conversation.