摘要: <script> let newVar=axios.create({ baseURL:'http://localhost:8080/student', timeout:5000 });//创建axios实例 let newVar1=axios.create({ baseURL:'http://loc 阅读全文
posted @ 2020-12-24 22:04 Mr_sven 阅读(439) 评论(0) 推荐(0) 编辑
摘要: <script> axios.defaults.baseURL='http://localhost:8080/student';//配置全局属性 axios.defaults.timeout=10000;//超时10s axios.get('getAllstudent').then(res=>{// 阅读全文
posted @ 2020-12-24 21:51 Mr_sven 阅读(296) 评论(0) 推荐(0) 编辑
摘要: Object.assign()是浅拷贝。 Object.assign()合并成一个新的对象再赋值 Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象 例: this.seller=Object.assign({},this.seller,new.data) 阅读全文
posted @ 2020-12-24 20:39 Mr_sven 阅读(3230) 评论(0) 推荐(0) 编辑
摘要: splice(index,len,[item])它也可以用来替换/删除/添加数组内某一个或者几个值(该方法会改变原始数组) index:数组开始下标 len: 替换/删除的长度 item:替换的值,删除操作的话 item为空 删除: //删除起始下标为1,长度为1的一个值(len设置1,如果为0,则 阅读全文
posted @ 2020-12-24 20:28 Mr_sven 阅读(2589) 评论(0) 推荐(0) 编辑
摘要: 一、前言 最近项目中,遇到需要将对象转换成字符串进行传递,上次写过一篇文章关于json字符串转换成json对象,json对象转换成字符串,值转换成字符串,字符串转成值。当时主要是用在有时候处理字符串和json对象之间的转换,写的主要是怎么用,涉及到JSONstringify具体用法没有涉及到,有时候 阅读全文
posted @ 2020-12-24 20:06 Mr_sven 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 方式一 <script> axios([ axios.get('http://localhost:8080/student/getAllStudent'), axios.post('http://localhost:8080/student/getStudentById',{id:1}) ]).th 阅读全文
posted @ 2020-12-24 07:48 Mr_sven 阅读(115) 评论(0) 推荐(0) 编辑