search

Home  >  Q&A  >  body text

javascript - Regarding using the Vue framework on the front end and WordPress on the back end, how to call the back-end functions?

Blog information is displayed in the

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.

PHP中文网PHP中文网2797 days ago622

reply all(4)I'll reply

  • 阿神

    阿神2017-05-19 10:17:07

    It can’t be written.
    This needs to be parsed through vueLoader. It cannot be written like this without using php
    .

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:17:07

    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

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-19 10:17:07

    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

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-19 10:17:07

    If it’s php rendering, your writing method is fine, but you can’t use .vue files.

    reply
    0
  • Cancelreply