vue-django-rest-framework项目地址欢迎fork在线demo这是一个使用Vue和Django的应用示例。使用ElementUI搭建前端模板后端使用django-rest-framework提供apiswagger前后端api对接文档实现了三层注释JWT登录faker模拟数据的功能,即比前端Mockapi操作更强大,前端使用axios,后端使用rest_framework标签云。有BUG,从别处移植过来的。作者:mikeledate:2019-12-26一些说明wiki前端src/store使用vuex保存name,token等state可以保存在cookie或者localStoragesrc/api和后端api接口使用axossrc/router路由,也就是导航的url对接*.vue文件如果太多无法归类,参考src/router/modules//src/router/modules/blog.jsconstblogRouter...//src/router/index.jsimportblogRouterinsrc/router/indexfrom'./modules/blog'...exportconstconstantRoutes=[...blogRouter,]src/components经常用到,封装成组件,比如comment,三-图层注释src/filters时间过滤//使用{{created|parseTime}}src/layout背景框,也可以做成前台框Globalstyles//src/styles/element-ui.scss//formobilephone@mediaonlyscreenand(max-width:414px){.hidden-s-only{display:none!important}}@mediaonlyscreenand(min-width:415px){.hidden-s-and-up{display:none!important}}src/utils请求中间件,类似中间件在python//src/utils/api.jsconfig.headers['Authorization']=getToken()//src/utils/auth.jsconstTokenKey='Authorization'...exportfunctionsetToken(token){returnCookies.set(TokenKey,'JWT'+token)}三层注释
