mercredi 3 juillet 2019

Making imported vue components accessible throughout a Laravel app

I have a hybrid app with Laravel and vue.js (as against a pure vue SPA talking to APIs in Laravel).

Now, vue.js has slots so that the parent component can pass data to a child component, and the child component can display the data as it pleases. But that "design pattern" doesnt work, does it? What if I have a header blade file or html file, and it is not a subcomponent. I want to show slot data there. Is that possible to do?

In this gist: https://gist.github.com/connecteev/b8fa305e0364cd28bca772b7149ad340 I'm trying to trigger the drawer from within the header...basically make the components imported from the vue library from anywhere in my Laravel app (I am also open to new ways of structuring the code...I have a burning sense that I'm not doing it right).

Thank you for your comments.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire