{"id":135,"date":"2021-01-21T21:31:47","date_gmt":"2021-01-21T13:31:47","guid":{"rendered":"http:\/\/gjweb.top\/?p=135"},"modified":"2021-01-21T21:31:49","modified_gmt":"2021-01-21T13:31:49","slug":"%e8%8a%82%e6%b5%81%e5%92%8c%e9%98%b2%e6%8a%96","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=135","title":{"rendered":"\u8282\u6d41\u548c\u9632\u6296"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u9632\u6296\u51fd\u6570<\/h2>\n\n\n\n<p>\u5f53\u6301\u7eed\u89e6\u53d1\u4e8b\u4ef6 \u4e00\u5b9a\u65f6\u95f4\u5185\u6ca1\u6709\u5728\u89e6\u53d1\u4e8b\u4ef6 \u65f6\u95f4\u5904\u7406\u51fd\u6570\u624d\u4f1a\u6267\u884c\u4e00\u6b21;\u5982\u679c\u8bbe\u5b9a\u7684\u65f6\u95f4\u5230\u6765\u4e4b\u524d \u6709\u4e00\u6b21\u89e6\u53d1\u4e86\u4e8b\u4ef6 \u5c31\u91cd\u65b0\u5f00\u59cb\u5ef6\u65f6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u5229\u7528\u95ed\u5305\nfunction  deounce(fun,delay){\n    let timer\n    return function(args){\n        clearInterval(timer)\n        timer = setTimeout(function(){\n            fun(args)\n        },delay)\n    }\n}\nfunction inputFun(value){\n    console.log(`\u4f60\u8f93\u51fa\u7684\u7ed3\u679c\u662f${value}`)\n}\nconst input = document.getElementById(\"input\")\nconst debounceInput = deounce(inputFun,1000)\ninput.addEventListener('keyup',function(e){\n    debounceInput(e.target.value)\n})<\/code><\/pre>\n\n\n\n<p>\u5e94\u7528\u573a\u666f<\/p>\n\n\n\n<p>\u8f93\u5165\u641c\u7d22\uff1a \u8f93\u5165\u7ed3\u675f\u540en\u79d2\u624d\u8fdb\u884c\u641c\u7d22\u8bf7\u6c42\uff0cn\u79d2\u5185\u6709\u8f93\u5165\u7684\u5185\u5bb9,\u5c31\u91cd\u65b0\u8ba1\u65f6\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u8282\u6d41\u51fd\u6570<\/h2>\n\n\n\n<p>\u5f53\u6301\u7eed\u89e6\u53d1\u4e8b\u4ef6\u7684\u65f6\u5019 \u4fdd\u8bc1\u4e00\u6bb5\u65f6\u95f4\u5185 \u53ea\u8c03\u7528\u4e00\u6b21\u65f6\u95f4\u5904\u7406\u51fd\u6570<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function throttle(func,wait){\n    let timerOut\n    return functiuon(){\n        if(!timerOut){\n            timerOut = setTimeout(function(){\n                timerOut = null\n                func()\n            },wait)\n        }\n    }\n}\nfunction  handle(){\n      console.log(math.random())\n}\ndocument.getElementById(\"button\").onclick = throttle(handle,2000)<\/code><\/pre>\n\n\n\n<p>\u7ecf\u5178\u6848\u4f8b<\/p>\n\n\n\n<p>\u9f20\u6807\u4e0d\u65ad\u70b9\u51fb\u89e6\u53d1,\u89c4\u5b9a\u5728n\u79d2\u5185\u591a\u6b21\u70b9\u51fb\u53ea\u6709\u4e00\u6b21\u751f\u6548.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9632\u6296\u51fd\u6570 \u5f53\u6301\u7eed\u89e6\u53d1\u4e8b\u4ef6 \u4e00\u5b9a\u65f6\u95f4\u5185\u6ca1\u6709\u5728\u89e6\u53d1\u4e8b\u4ef6 \u65f6\u95f4\u5904\u7406\u51fd\u6570\u624d\u4f1a\u6267\u884c\u4e00\u6b21;\u5982\u679c\u8bbe\u5b9a\u7684\u65f6\u95f4\u5230\u6765\u4e4b\u524d \u6709\u4e00\u6b21\u89e6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":0,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}