EvanAgee / vuejs-wordpress-theme-starter

A WordPress theme with the guts ripped out and replaced with Vue.
https://vuewp.com/
1.6k stars 281 forks source link

Best Way to Add Reactive Components to Posts / Pages? #109

Closed harrisonfm closed 4 years ago

harrisonfm commented 4 years ago

I'm a Vue novice trying to learn the framework in the context of WP development, so thanks for the work so far on it.

One thing I'm trying to do is add a component to my Posts that features something simple like lightboxing within Vue rather than falling back to writing scripts outside it. My issue is that the v-html directive to add the post content doesn't allow reactivity, and it looks very hard to add components dynamically when it's editor content pulled from the Rest API. I'm curious what the best design pattern is for something like this.