Replies: 5 comments 1 reply
-
I don't have any specific experience with Vue components, but you're right: The CSS file will need to be manually added to the theme. I would move it to |
Beta Was this translation helpful? Give feedback.
-
(I've converted this to a discussion—happy to continue the conversation here if you have other questions!) |
Beta Was this translation helpful? Give feedback.
-
I think i figured it out: I created a
Then in i adjusted the following npm scripts in
And installed Then in
And in
Almost forgot, I also changed I'm not sure yet if mounting to #page is a good idea. Perhaps this wil have performance problems down the road? But this setup allows me to create vue components (for the menu for example) and add them here and there. The reason I'm doing this is because I really like writing in vue and tailwind. So I want to do as much in html / css / js in vue and give them the data they need via php. This way I hope to separate data retrieval (from WP via php) and presentation (vue and tw) and not mix them as is the normal way with wp templating. |
Beta Was this translation helpful? Give feedback.
-
The only thing I didn't get working yet is the hot reloading. Do you have any suggestions for that? |
Beta Was this translation helpful? Give feedback.
-
I haven't used Vue with WordPress, so this isn't in my wheelhouse. (I almost exclusively use Alpine.js.) When I did use Vue, I used the Vue CLI directly. The most I can say is that the Browsersync documentation might give you some inspiration in finding approach to integrating the Vue CLI with _tw's watch command. |
Beta Was this translation helpful? Give feedback.
-
I'd like to add vue components to the theme. I've got esbuild-plugin-vue3 to work with javascript/scripts.js as a starting point, but i'm not sure how to incorporate this with the rest of the theme.
E.g. esbuild-plugin-vue3 generates a js file and a css file, both in the same dir. Should i move the css file to the tailwind/custom folder and include it in tailwind.css?
Do you have any suggestions how to go about this?
Beta Was this translation helpful? Give feedback.
All reactions