-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add StyleSheet or Javascript from Component? #168
Comments
Sorry, this code was added as specs but it is not implemented yet. Currently components add javascript/css code directly to the page on https://github.com/givanz/Vvveb/blob/master/public/js/vvvebjs/components-widgets.js#L667-L685 https://github.com/givanz/Vvveb/blob/master/public/js/vvvebjs/components-elements.js#L1097 |
Thanks @givanz, |
This feature will be implemented after more components will be added, currently has low priority. I will mention this issue when adding the feature. |
I found a little workaround for the moment. It's possible to import vue via cdn e.g. <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.5.12/vue.global.prod.min.js"></script> And than after the tag insert and close them appropriatly bevor the . Now everything between the div tags is part of the vue app. On the docs page in the example (https://vuejs.org/examples/) section are a lot of examples how to configure the app.
But there are some drawbacks. Vue is not active on the Editpage so you need to save the page and open the perview to get see if it works. Also you need to repeat the step with the div tags for each page and I presume they state of the page gets lost whene you change the page. Also on the server side is still the php backend. And offcourse the modularity of the components suffers a bit. I guess since vue can be used in a similar way as jquery, most of those limitations should disappear with a proper theme and with vues templating engine that should be somewhat easier to accomplish than with jsx. May be even nuxt is possible if I could trigger a static build via php. |
I checked in the source code has attribute "stylesheets" and "javascripts", but when the component was pulled in, it seems not to be working.
The text was updated successfully, but these errors were encountered: