{"id":126140,"date":"2020-01-16T11:30:13","date_gmt":"2020-01-16T03:30:13","guid":{"rendered":"http:\/\/4563.org\/?p=126140"},"modified":"2020-01-16T11:30:13","modified_gmt":"2020-01-16T03:30:13","slug":"%e5%89%8d%e7%ab%af-%e9%bc%a0%e6%a0%87%e6%bb%91%e5%8a%a8%e5%ae%9e%e7%8e%b0%e9%ab%98%e4%ba%ae%e4%b8%8e%e5%a4%8d%e5%88%b6","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=126140","title":{"rendered":"\u524d\u7aef-\u9f20\u6807\u6ed1\u52a8\u5b9e\u73b0\u9ad8\u4eae\u4e0e\u590d\u5236"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u524d\u7aef-\u9f20\u6807\u6ed1\u52a8\u5b9e\u73b0\u9ad8\u4eae\u4e0e\u590d\u5236               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Oilybear <\/span>  <span><i><\/i> 53<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5927\u5bb6\u597d\uff0c\u6700\u8fd1\u7684\u9879\u76ee\u9700\u6c42\u4e2d\uff0c\u6709\u4e00\u9879\u524d\u7aef\u9700\u6c42\u56f0\u6270\u7740\u5f1f\u5f1f\u3002<\/p>\n<h2>\u9879\u76ee\u80cc\u666f\uff1a<\/h2>\n<p>\u524d\u7aef React \u6846\u67b6<\/p>\n<h2>\u9700\u6c42\u5982\u4e0b\uff1a<\/h2>\n<ol>\n<li>\u9f20\u6807\u6ed1\u52a8\u9009\u4e2d\u4e00\u6bb5\u6587\u5b57\uff0c\u5b9e\u73b0\u5bf9\u9009\u4e2d\u6587\u5b57\u7684\u9ad8\u4eae\uff0c\u5e76\u590d\u5236\u6587\u5b57<\/li>\n<\/ol>\n<h2>\u95ee\u9898\uff1a<\/h2>\n<ol>\n<li>\u662f\u5426\u6709\u73b0\u6210\u7684\u63a7\u4ef6\u53ef\u4ee5\u652f\u6301\u8fd9\u4e00\u9700\u6c42<\/li>\n<li>\u5982\u679c\u9700\u8981\u81ea\u5df1\u624b\u5199\u63a7\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ec0\u4e48\u6837\u7684\u5b9e\u73b0\u601d\u8def\u53bb\u5b9e\u73b0 \u4e0d\u77e5\u9053\u5404\u4f4d\u670b\u53cb\u6709\u4ec0\u4e48\u9ad8\u62db      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"65992\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : findsomeone <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u89c9\u5f97\u5e94\u8be5\u4e0d\u4f1a\u5f88\u96be\uff1f \u6bd4\u5982\u73b0\u5728\u5404\u79cd chrome \u7ffb\u8bd1\u63d2\u4ef6\u90fd\u6709\u5212\u8bcd\u7ffb\u8bd1 \u800c\u4e14\u4e00\u822c\u4e5f\u5f00\u6e90 \u53c2\u8003\u4e0b\u76d1\u63a7\u4e8b\u4ef6\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65993\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : orzorzorzorz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u590d\u5236\u7684\u8bdd\uff0c\u7b80\u5355\u7c97\u66b4\u5c31\u662f document.execCommand(&#8216;copy&#8217;)\u3002\u94fe\u63a5\u5728[\u8fd9\u91cc]( https:\/\/stackoverflow.com\/questions\/6300213\/copy-selected-text-to-the-clipboard-without-using-flash-must-be-cross-browser)<br \/>\u6539\u9ad8\u4eae\u7684\u8bdd\u6709\u4e24\u79cd\u601d\u8def\uff0c\u4e00\u79cd\u662f\u76f4\u63a5\u6539 ::selection\uff0c\u4e00\u79cd\u662f\u53bb\u6389 ::selection \u7684\u9ed8\u8ba4\u6837\u5f0f\uff0c\u60f3\u529e\u6cd5\u83b7\u5f97\u9009\u4e2d\u65f6\u7684\u5b57\uff0c\u7136\u540e\u6539\u8fd9\u4e9b\u5b57\u6240\u5728 dom \u7684\u6837\u5f0f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65994\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : orzorzorzorz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u8ddf re \u4e0d react \u6ca1\u5565\u5173\u7cfb\uff0c\u5e02\u9762\u4e0a\u6211\u662f\u6ca1\u89c1\u8fc7\u6709\u8fd9\u6837\u7684\u7ec4\u4ef6\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65995\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RV0n <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             window.getSelection()\u83b7\u53d6\u9009\u4e2d\u6587\u5b57 \u518d\u8d70\u6b63\u5219\u5339\u914d \u5339\u914d\u6587\u5b57\u663e\u793a\u9ad8\u4eae \u518d\u5229\u7528 clipboard \u5b9e\u73b0\u590d\u5236                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65996\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : orzorzorzorz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/github.com\/bvaughn\/react-highlight-words<br \/>\u67e5\u4e86\u4e0b\uff0c\u662f\u6709\u4e2a\u76f8\u5173\u7684\u5e93\uff0c\u770b\u4e0a\u53bb\u80fd\u7528\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65997\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Oilybear <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @orzorzorzorz \u8c22\u8c22\u5927\u4f6c\uff0c\u521a\u521a\u6211\u5728\u9700\u6c42\u8868\u8ff0\u4e0a\u51fa\u73b0\u4e86\u95ee\u9898\uff0c\u590d\u5236\u6587\u5b57\u5982\u679c\u53d8\u5316\u4e3a\u83b7\u53d6\u6587\u5b57\u76f8\u5bf9\u4e00\u6bb5\u6587\u5b57\u7684\u4f4d\u7f6e\u7684\u8bdd\u3002\u4e0d\u77e5\u6709\u4ec0\u4e48\u597d\u7684\u601d\u8def\u5b9e\u73b0\u3002\u4f8b\u5b50\u5df2\u6dfb\u52a0\u5230\u9644\u8a00\u4e2d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65998\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Oilybear <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @findsomeone \u597d\u7684\uff0c\u6211\u53bb\u53c2\u8003\u4e00\u4e0b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"65999\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : learnshare <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             MDN: selection &amp; range                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"66000\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Cbdy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6d4f\u89c8\u5668\u7ed9\u4f60\u63d0\u4f9b\u4e86 onSelect \u4e8b\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"66001\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : netnr <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/www.netnr.com\/run\/code\/5068762375722166316<\/p>\n<p>\u5199\u4e86\u4e2a \u5355\u8282\u70b9 \u9009\u4e2d\u9ad8\u4eae\u7684 demo\uff0c\u8de8\u8282\u70b9\u9700\u8981\u66f4\u590d\u6742\u7684\u903b\u8f91\u5224\u65ad\uff0c\u5df2\u62ff\u5230\u9009\u4e2d\u5185\u5bb9\u5982\u4f55\u590d\u5236\u5e94\u8be5\u4e0d\u6210\u95ee\u9898\u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"66002\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : oubenruing <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Range \u4e86\u89e3\u4e0b https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/API\/Range                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u7aef-\u9f20\u6807\u6ed1\u52a8\u5b9e\u73b0\u9ad8\u4eae\u4e0e\u590d\u5236 \u8cc7\u6df1&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/126140"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=126140"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/126140\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=126140"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=126140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}