Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Laravel includes inside a vue component?

I have a set of components, some components include other components via @include('my-sub-component')

The issue is that when I want to use vue I have to put the entire component in the vue.js file inside the template tags.

But inside the template I want to use the @include so I can include some sub components. This does not work.

How can I include blade components inside a vue component?

like image 483
panthro Avatar asked Mar 27 '26 07:03

panthro


1 Answers

As far as I know, it's impossible. You can't use PHP (Laravel Blade) .blade.php tags inside Vue Component .js, of course Vue can't execute PHP script in this case. The possible use case is you use the Vue Component inside Laravel Blade.

like image 126
nmfzone Avatar answered Mar 29 '26 22:03

nmfzone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!