{"id":6538,"date":"2023-01-08T21:36:51","date_gmt":"2023-01-08T13:36:51","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=6538"},"modified":"2023-01-08T21:36:51","modified_gmt":"2023-01-08T13:36:51","slug":"%e4%bd%bf%e7%94%a8react-js%e6%b1%82%e5%8f%96%e5%8d%94%e6%96%b9%e5%b7%ae%ef%bc%9a%e4%b8%80%e5%80%8b%e7%b0%a1%e5%96%ae%e7%9a%84%e6%8c%87%e5%8d%97-3","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/react-js\/%e4%bd%bf%e7%94%a8react-js%e6%b1%82%e5%8f%96%e5%8d%94%e6%96%b9%e5%b7%ae%ef%bc%9a%e4%b8%80%e5%80%8b%e7%b0%a1%e5%96%ae%e7%9a%84%e6%8c%87%e5%8d%97-3\/","title":{"rendered":"\u4f7f\u7528React.JS\u6c42\u53d6\u5354\u65b9\u5dee\uff1a\u4e00\u500b\u7c21\u55ae\u7684\u6307\u5357"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"React, List, Covariance\"><\/p>\n<h1>\u4f7f\u7528 React.JS \u6c42\u534f\u65b9\u5dee(covariance)<\/h1>\n<p>\u534f\u65b9\u5dee(covariance)\u662f\u4e00\u7a2e\u7d71\u8a08\u6280\u8853\uff0c\u7528\u65bc\u8861\u91cf\u5169\u500b\u8b8a\u91cf\u4e4b\u9593\u7684\u7dda\u6027\u95dc\u4fc2\u3002\u5b83\u53ef\u4ee5\u7528\u4f86\u6e2c\u91cf\u5169\u500b\u8b8a\u91cf\u4e4b\u9593\u7684\u76f8\u95dc\u6027\uff0c\u4e26\u4e14\u53ef\u4ee5\u7528\u4f86\u9810\u6e2c\u5169\u500b\u8b8a\u91cf\u4e4b\u9593\u7684\u8b8a\u5316\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528 React.JS \u4f86\u6c42\u53d6\u5354\u65b9\u5dee\u3002<\/p>\n<h2>\u4f7f\u7528 React.JS \u6c42\u53d6\u5354\u65b9\u5dee<\/h2>\n<p>React.JS \u662f\u4e00\u500b JavaScript \u6846\u67b6\uff0c\u53ef\u4ee5\u7528\u65bc\u958b\u767c\u9ad8\u6027\u80fd\u7684 Web \u548c\u79fb\u52d5\u61c9\u7528\u7a0b\u5e8f\u3002\u5b83\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u5feb\u901f\u958b\u767c\u548c\u90e8\u7f72\u61c9\u7528\u7a0b\u5e8f\uff0c\u4e26\u4e14\u53ef\u4ee5\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u7528\u6236\u9ad4\u9a57\u3002<\/p>\n<p>React.JS \u63d0\u4f9b\u4e86\u4e00\u500b\u53eb\u505a React List \u7684 API\uff0c\u53ef\u4ee5\u7528\u65bc\u6c42\u53d6\u5354\u65b9\u5dee\u3002React List \u662f\u4e00\u500b\u9ad8\u6027\u80fd\u7684 JavaScript \u5eab\uff0c\u53ef\u4ee5\u7528\u65bc\u8655\u7406\u5927\u91cf\u7684\u6578\u64da\u3002\u5b83\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u5feb\u901f\u6c42\u53d6\u5354\u65b9\u5dee\uff0c\u4e26\u4e14\u53ef\u4ee5\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u7528\u6236\u9ad4\u9a57\u3002<\/p>\n<p>\u8981\u4f7f\u7528 React List \u6c42\u53d6\u5354\u65b9\u5dee\uff0c\u9996\u5148\u9700\u8981\u5b89\u88dd React List \u5eab\u3002\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u4f86\u6c42\u53d6\u5354\u65b9\u5dee\uff1a<\/p>\n<pre class=\"brush: javascript\">\nimport ReactList from 'react-list';\n\nconst data = [\n  [1, 2, 3],\n  [4, 5, 6],\n  [7, 8, 9]\n];\n\nconst covariance = ReactList.covariance(data);\n\nconsole.log(covariance);\n<\/pre>\n<p>\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u6703\u5c07\u7d66\u5b9a\u7684\u6578\u64da\u8f49\u63db\u70ba React List \u5c0d\u8c61\uff0c\u4e26\u4f7f\u7528 React List \u7684 covariance() \u65b9\u6cd5\u4f86\u6c42\u53d6\u5354\u65b9\u5dee\u3002<\/p>\n<p>React List \u63d0\u4f9b\u4e86\u4e00\u500b\u9ad8\u6027\u80fd\u7684 API\uff0c\u53ef\u4ee5\u7528\u65bc\u6c42\u53d6\u5354\u65b9\u5dee\u3002\u5b83\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u5feb\u901f\u6c42\u53d6\u5354\u65b9\u5dee\uff0c\u4e26\u4e14\u53ef\u4ee5\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u7528\u6236\u9ad4\u9a57\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u4ecb\u7d39\u4e86\u5982\u4f55\u4f7f\u7528 React.JS \u4f86\u6c42\u53d6\u5354\u65b9\u5dee\u3002\u6211\u5011\u4f7f\u7528\u4e86 React List \u5eab\u4f86\u6c42\u53d6\u5354\u65b9\u5dee\uff0c\u4e26\u4e14\u53ef\u4ee5\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u7528\u6236\u9ad4\u9a57\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528React.JS\u6c42\u53d6\u5354\u65b9\u5dee\uff0c\u4e26\u63d0\u4f9b\u4e00\u500b\u7c21\u55ae\u7684\u6307\u5357\uff0c\u8b93\u8b80\u8005\u53ef\u4ee5\u8f15\u9b06\u5730\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528React.JS\u6c42\u53d6\u5354\u65b9\u5dee\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[184,183],"tags":[182,181],"class_list":["post-6538","post","type-post","status-publish","format-standard","hentry","category-react","category-react-js","tag-react","tag-react-js"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1Hs","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=6538"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6538\/revisions"}],"predecessor-version":[{"id":6539,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6538\/revisions\/6539"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=6538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=6538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=6538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}