摘要: 组件是可复用的vue实例,一个组件被创建好之后,就可能被用在各个地方,而组件不管被复用了多少次,组件中的data数据都应该是相互隔离,互不影响的,基于这一理念,组件每复用一次,data数据就应该被复制一次,之后,当某一处复用的地方组件内data数据被改变时,其他复用地方组件的data数据不受影响。 阅读全文
posted @ 2020-04-21 17:07 seeBetter 阅读(183) 评论(0) 推荐(0)
摘要: 1 实现数组的reduce方法 if (!Array.prototype.reduceC) { Array.prototype.reduceC = function(callback /*, initialValue*/) { 'use strict'; if (this null) { throw 阅读全文
posted @ 2020-04-21 10:58 seeBetter 阅读(150) 评论(0) 推荐(0)
摘要: fetch 1 fetch是基于promise实现的,用的时候可以结合async/await;2 fetch请求默认是不带cookie的,需要设置fetch(URL,{credentials:’include’}),Credentials有三种参数:same-origin,include,omit: 阅读全文
posted @ 2020-04-21 10:25 seeBetter 阅读(402) 评论(0) 推荐(0)
摘要: 基本使用 axios({ method: 'get', // get,获取数据;post,提交数据(表单提交以及文件上传);put,更新数据 (提交所有的数据);patch,提交数据 (提交修改的数据);delete,删除数据 url: '', params: {} }).then(res => { 阅读全文
posted @ 2020-04-21 09:29 seeBetter 阅读(281) 评论(0) 推荐(0)