摘要: 方法一 直接绑定在原生事件上,这个一般是用来捕捉编辑的时候的事件,用的不多 <textarea onKeyDown={e=> console.log( e.keyCode ) } /> 方法二 export class KeyBind extends React.Component { compon 阅读全文
posted @ 2020-12-02 21:18 公瑾当年 阅读(3127) 评论(0) 推荐(0) 编辑
摘要: 很经典的例子是0.1+0.2!=0.3(实际等于 0.30000000000000004) 不等的原因 机器中采用二进制存储数据, 比如,35会被存储为: 00100011 (25 + 21 + 20)。 0.375会被存储为: 0.011 (1/22 + 1/2^3 = 1/4 + 1/8 = 0 阅读全文
posted @ 2020-12-02 21:08 公瑾当年 阅读(6819) 评论(0) 推荐(0) 编辑