search

Home  >  Q&A  >  body text

javascript - How vue works with the backend

I wrote a project using vue and ran bulid to generate the dist file. How do I cooperate with the backend? . Previous projects were all about converting html into php files.
1. The separation of vue's front-end and back-end means keeping the file format in dist unchanged without making any changes?
2. The data in the project are all mocked. Obtain data through the interface provided by the backend. What is the interface like?
3. Are there any complete project recommendations? It is all the code placed on the server, using vue as the front end, and there are back-end codes and interface documents

过去多啦不再A梦过去多啦不再A梦2752 days ago579

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-19 10:12:27

    From the question, it seems that you are relatively vague about the front-end. The mode you are talking about is a single-page application

    I recommend you to read and study this project,star 6480

    https://github.com/bailicangd...

    Technology stack

    vue2 + vuex + vue-router + webpack + ES6/7 + fetch + sass + flex + svg

    You can learn how to use Vue to develop a single page and interact with the server, and you can understand vuex

    reply
    0
  • 阿神

    阿神2017-05-19 10:12:27

    Tell me what time.
    1. The front-end development of vue generally uses src---webpack---dist. The final deployment on the server is the dist file. Webpack can be simply understood as a compilation process.
    2. If you use vue-cli (of course others can also be used, but vue-cli has been integrated for you), there is http-proxy-middleware for interface transfer. If the pure static page is deployed on the server, you need to pass nginx or other server software for transfer.
    3. Recruit projects on GitHub, which are generally involved in projects that adjust third-party interfaces.

    reply
    0
  • Cancelreply