Is there a way to add vuejs app on a single that doenst tie to any resource?
Is there a way to add Vue app on a single custom page that doesn't tie to any resource?
12 Replies
Should be possible... I think you need to wrap the Vue section of your page with a
wire:ignore
. And probably best not to use wire:navigate
.i am very noob-ish to filament.
i have a custom report page where I'd like to embed vue app into it. will you point me to a direction or any reading material? thanks
I don't know any tutorial that specific on Filament + Vue, but maybe I can help you figure things out. Are you more experienced in Vue or is this also a bit new to you?
i am very experienced in vue and laravel. i just need help figuring out how to inject vue app into a custom filament page so i can do crazy stuff.
Sounds good
So I guess the first question is how do you load Vue into Filament? Do you have everything bundled up in
dist/app.js
or something like that?i am using official inertia + with vue from laravel.
i have not bundled up anyting yet.
Oh ok. I'm not sure that Inertia is compatible with Filament actually...
that's totally fine. if i can just use a vue instance via script tag, that'll be nice.
I mean on the same page... surely you can use both in the same app, but probably not on the same page.
Solution
Yes, I think that's the way to go
Ok, so I'll leave the details of bundling to you, but basically you can use the standard Vite setup that Laravel offers. You can register your bundle as a Filament asset:
https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files
Then if your Vue app is designed to mount on
#app
, add the element to your custom page filament.pages.reports
with a wire:ignore
attribute: