Hi Lisa,
Your article is exactly what I was hoping to find on the internet, thank you so much for this.
Now I have a question.. How do I print WordPress/PHP values using vue js.
For example, in a blog page, I may use Vue to generate the HTML template & the interaction aspects.. but I would like the actual values in the template to be WordPress values such as the_title(); the_excerpt (); and so on..
Hi Lisa,
Your article is exactly what I was hoping to find on the internet, thank you so much for this.
Now I have a question.. How do I print WordPress/PHP values using vue js.
For example, in a blog page, I may use Vue to generate the HTML template & the interaction aspects.. but I would like the actual values in the template to be WordPress values such as the_title(); the_excerpt (); and so on..
How do I accomplish this?
Good question!
I think your best approach would be to set up a component, and pass the the_title(); etc. in as a prop (variable).
See: vuejs.org/v2/guide/components.html
This will guide you through making a component.
Passing props (variables into your components):
vuejs.org/v2/guide/components.html...
In the end, you'd end up with something like..
in vuecode.js
In your template:
Note: In the example tutorial, it adds a shortcode.
In your case, you probably wouldn't need it, since it sounds like you're doing this through the template. Shortcodes work better on the text side.
Good luck!