tag. The official wordpress writing method is like this
If I use vue as the front-end framework, how do I add this code to the php code (my writing method is definitely wrong)
Question: I would like to ask how to write such a situation, thank you, I am a newbie still figuring it out.
It can’t be written.
This needs to be parsed through vueLoader. It cannot be written like this without using php
.
You need to separate the front and back ends ~~ Use ajax to request, vue-resource is not officially recommended. It is recommended to use axios
The front and back ends are separated, the routing front end is determined, PHP only returns the interface data, or the front end is mixed with PHP, so there is no need for the Vue framework
If it’s php rendering, your writing method is fine, but you can’t use .vue files.