上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 25 下一页
摘要: 1.结论:forEach、map不支持异步变同步。 let arr=[1,2,3,4,5]; function asyncEvent(ele){ return new Promise(resolve=>{ setTimeout(e=>{ console.log(e); resolve(e) },10 阅读全文
posted @ 2020-07-14 15:41 炽橙子 阅读(2231) 评论(0) 推荐(0)
摘要: // 获取省 getSheng() { return new Promise((resolve, reject) => { axios.get(BASEURL + '/phone/Controllers/', { params: { _action: "1bd2b39b-c393-4dc9-81e3 阅读全文
posted @ 2020-07-10 10:45 炽橙子 阅读(1101) 评论(0) 推荐(0)
摘要: 1. 映射到本地的文件。 按要求输入相关的规则就可以了。 除了用上面的插件,其实在AutoResponder上用正则更方便,如下: 服务器上的资源:REGEX:http://cdn.mingsixue.com/(.*) 本地的资源:http://blog.me/resources/$1 需要注意的是 阅读全文
posted @ 2020-06-10 21:32 炽橙子 阅读(234) 评论(0) 推荐(0)
摘要: let area = str.replace(/\//g, ""); 去掉/ var str = str.replace(/#.*|\//g,''); 去掉/和#后面的字符 var str=str.replace(/^.*#/g,''); 去掉#前面的字符 var str="Hello world! 阅读全文
posted @ 2020-06-05 11:14 炽橙子 阅读(219) 评论(0) 推荐(0)
摘要: 1.new Date()传参有多种形式 avaScript下,new Date([params]),参数传递有以下五种方式: 1、new Date("month dd,yyyy hh:mm:ss"); 2、new Date("month dd,yyyy"); 3、new Date(yyyy,mth, 阅读全文
posted @ 2020-06-04 16:16 炽橙子 阅读(7042) 评论(0) 推荐(0)
摘要: 进行post提交时 1.需要进行序列化转换 // Form Data方式 (默认是这种方式) // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; 2.. 阅读全文
posted @ 2020-06-03 09:48 炽橙子 阅读(12362) 评论(0) 推荐(0)
摘要: 错误: 1.ajax请求时是不会自动带上cookie的,要是想让他带上的话,必须设置withCredential为true。 正确: 1.ajax同域请求下,ajax会自动带上同源的cookie; 2.ajax同域请求下,ajax添加自定义请求头(或原装)header,前端、后台不需要增加任何配置, 阅读全文
posted @ 2020-06-02 09:21 炽橙子 阅读(2960) 评论(0) 推荐(0)
摘要: 1. application/x-www-form-urlencoded 默认。在发送前对所有字符进行编码(将空格转换为 "+" 符号,特殊字符转换为 ASCII HEX 值)。 multipart/form-data 不对字符编码。当使用有文件上传控件的表单时,该值是必需的。 text/plain 阅读全文
posted @ 2020-05-31 17:31 炽橙子 阅读(290) 评论(0) 推荐(0)
摘要: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 阅读全文
posted @ 2020-05-26 08:45 炽橙子 阅读(713) 评论(0) 推荐(1)
摘要: // 父组件传值到子组件中。class WebSite extends React.Component { constructor() { super(); this.state = { name: "菜鸟教程", site: "https://www.runoob.com" } } render( 阅读全文
posted @ 2020-05-25 11:13 炽橙子 阅读(155) 评论(0) 推荐(0)
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 25 下一页