摘要: 理论上可以用于任何元素,生效时会在元素上出现一个同大小的灰色蒙层(button元素会该表原生的disabled属性)。 /** * 当元素触发发起请求后,当发起的请求中最后一个请求的结果返回(不关心返回顺序和结果),解锁元素禁用。 * 优化:用一个pending记录所有请求,逐个判定是否返回结果。 阅读全文
posted @ 2019-12-02 16:27 悠悠洛 阅读(558) 评论(0) 推荐(0) 编辑
摘要: function compare(a, b) { const typeA = {}.toString.call(a); const typeB = {}.toString.call(b); if (typeA !== typeB) return false; let result = false; 阅读全文
posted @ 2019-12-02 16:19 悠悠洛 阅读(225) 评论(0) 推荐(0) 编辑