[Vuejs]-In php blade file Client tokens Vue components not showing

0👍

I experienced the same issue with laravel 8.x and resolved it as follows

  1. Make sure your installed the appropriate frontend scafolding with the below commands:

php artisan ui bootstrap and
php artisan ui vue

  1. Run the below commands:

npm install and
npm run dev

  1. Follow the below syntax to define your view components:
    Vue.component(
    ‘example-component’,
    require(‘./components/ExampleComponent.vue’).default
    );

  2. Include the vue component in your blade view file as follows:

@extends(‘layouts.app’)
@section(‘content’)

<example-component></example-component>

@endsection

  1. Recompile your vue components with the command:

npm run dev

Leave a comment