![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
es6
PurePeace
假程序猿(学生
展开
-
vue监听按下ctrl或shift
// 在页面钩子 mounted() 处调用此函数,增加按键监听事件watchKeyEvent () { const setKeyStatus = (keyCode, status) => { switch (keyCode) { case 16: if (this.onShfit === status) return console.log('shif', status ? '按下' : '抬起') this.onShfi.原创 2020-06-20 03:04:20 · 5010 阅读 · 1 评论 -
js实现类似python中time.sleep()的方法,ES7
主要使用了es6语法:async,awaitfunction sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms));}async function doSomething() { await sleep(3000); console.log('已经等待了3秒!!');}// ...原创 2020-03-28 08:08:09 · 2008 阅读 · 0 评论