javascript - Laravel和Vue配套如何做到前后端完全分离开发
黄舟
黄舟 2017-05-16 13:05:52
0
4
904

这算是个最基础的问题啦, 但是我一直在自学没有一点点相关的经验, 希望大佬们不要见怪...

Laravel5.4 + vue2.

虽然Laravel自带了一套vue的开发方式, 在resource/assets目录下写前端代码, 通过mix构建到public目录下. 但是这样的做法也是带有耦合的, 我想要的是, 分离得干干净净的, 我在这边写后端代码, 他们在那边用vue-cli搭建脚手架后在在那个脚手架下写前端代码, 写完后生成dist, dist直接复制过来就算部署好了.

这样的需求应该能做到吧? 我也搜了很多开源的DEMO, 但是都不是这样的. 求助.

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
黄舟

I made it out of boredom on May Day, you can take a look
github

某草草

The form of vue + laravel api is enough. This is the case in our company at present. Laravel is used to write the api and backend management system. Colleagues in the vue front-end team are responsible for calling the interface through the api document. This method is more suitable for mobile projects

我想大声告诉你

Yes, no matter you use larvael or yii framework, the front-end and back-end separation method is that the back-end provides API to return json data. Vue is used as the front end. When you first start developing, you can use mock data to simulate the interface data returned by the back end. When the interface is ready, then replace all requests to the URL provided by the backend.

伊谢尔伦

Write the interface document, implement the backend, and call the frontend

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!