技术栈:vue + element + vuex + webpack + axios + async-validator
多语言采用:vue-i18n 切换语言不需要刷新页面
权限控制:采用element admin 的路由拦截器 集成了 白名单 验证token功能
单页面(SPA single page web application)

优:
1.分离前后端关注点,各司其职
2.用户体验好、快,内容的改变不需要重新加载整个页面 不操作DOM(成本最高的操作)
3.服务器只接口提供数据,不用考虑页面逻辑和页面合成,提高性能
4.可以缓存较多数据,减少服务器压力
缺:
1.SEO问题
2.首次加载慢
3.用户操作需要写逻辑,前进、后退等(像native应用一样)
4.页面复杂度提高,复杂逻辑难度倍增
组件化
开发就是在写组件

上传组件的封装

文件打包
现在打包时已经没有静态资源
测试时打包为 22.3 KB

之前官网为 817MB


async-validator表单验证 分离测试接口url 和正式接口url 存储为全局变量方便调用 等等
网友评论