how does beego work with vue.js
how does beego work with vue.js
beego is the back end and vue is the front end. After implementing the front-end function through vue, execute npm run build
, and load the resulting file using beego.
if there's anything you can't use, you can normally use webpack to package, introduce HTML, and then read the backend address through JSON. Isn't it OK for the frontend to judge and verify?
1. Package, cnpm run build in vue.js to get the dist folder, which contains index.html and static folders.
2. Put the index.html directly under the view folder of the beego, then add a route to the route and controllers of the beego, and point to this index.html to access it.
3. Enter the static folder, copy all the files and folders inside, in the static folder that comes to beego, paste, have the same, then merge the folder.
4. Enter the route and you can access it.