- 博客(4)
- 收藏
- 关注
原创 隐式转换的应用
问题: Cookies.get( 'sidebarStatus') ? !!+Cookies.get( 'sidebarStatus'):true 涉及到隐式转换: + ! cookie得到的值是字符串类型.而三元表单式中显然需要的是布尔值."0" +Cookies.get('sidebarStatus')得到数字类型 0 且布尔值为false !+Cookies.get('sidebarStatus')得到true !!+Cookies.get('sidebarStatus')得到fa...
2022-03-20 21:47:41 96
原创 在请求拦截器中处理后端返回的数据
// 响应拦截器 instance.interceptors.response.use( response => { // reponse 中包含了服务器响应回来的内容,包含在 data 属性中 return response.data }, error => { return Promise.reject(error) } )
2022-03-16 21:59:56 600
原创 element-ul中form表单手机号的自定义校验
{ validator: (rule, value, callback) => { // value:要校验的数据 // callback:判断是否校验通过 // 通过:callback() // 不通过: callback(new Error('错误信息')) // 1.0 定义一个手机号的正则 var reg = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]...
2022-03-15 22:22:16 169
转载 学习git commit 命名规范
feat : 新功能 fix : 修复bug docs : 文档改变 style : 代码格式改变 refactor : 某个已有功能重构 perf : 性能优化 test : 增加测试 build : 改变了build工具 如 grunt换成了 npm revert : 撤销上一次的 commit chore : 构建过程或辅助工具的变动 ...
2022-03-11 17:54:31 263
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人