This is the most basic question, but I have been studying on my own and don’t have any relevant experience. I hope the big guys won’t take offense...
Laravel5.4 + vue2.
Although Laravel comes with a set of vue development methods, the front-end code is written in the resource/assets directory and built into the public directory through mix. However, this approach also involves coupling. What I want is separation. It has to be clean and tidy. I write the back-end code here, and they use vue-cli to build scaffolding over there and then write the front-end code under that scaffolding. After writing, a dist is generated, and the dist is copied directly and it is deployed.
Should such a requirement be achieved? I have also searched a lot of open source DEMOs, but they are not like this. Please help.
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