1. 程式人生 > 其它 >Deepin(Linux)安裝Wine出現依賴報錯的解決辦法

Deepin(Linux)安裝Wine出現依賴報錯的解決辦法

節流
 1 <!--
 2  * @Author: your TM_cc
 3  * @Date: 2021-10-31 19:10:34
 4  * @LastEditTime: 2021-10-31 19:15:51
 5  * @LastEditors: Please set LastEditors
 6  * @Description: In User Settings Edit
 7  * @FilePath: \節流.html
 8 -->
 9 <!DOCTYPE html>
10 <html lang="en">
11 <head>
12     <
meta charset="UTF-8"> 13 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 14 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 15 <title>節流-Throttling</title> 16 </head> 17 <body> 18 19 <button id="button">節流</button
> 20 21 <script> 22 23 function Throttling(func,wait){ 24 let timeout; 25 return function () { 26 if (!timeout){ 27 timeout = setTimeout(function () { 28 func() 29 timeout
= null; 30 },wait) 31 } 32 } 33 } 34 35 function handle(){ 36 console.log(Math.random()) 37 } 38 39 document.getElementById('button').onclick = Throttling(handle,2000) 40 41 // 點選兩秒後顯示一個隨機數,兩秒內不論點選多少次都不會在此產生一個隨機數 42 43 </script> 44 </body> 45 </html>