{"id":95170,"date":"2026-08-16T12:32:53","date_gmt":"2026-08-16T04:32:53","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/95170.html"},"modified":"2026-08-16T12:32:53","modified_gmt":"2026-08-16T04:32:53","slug":"%e7%88%ac%e8%99%ab%e8%a2%ab-react-%e5%8f%8d%e7%88%ac%e6%8b%a6%e6%ad%bb%ef%bc%9f%e7%9f%a5%e4%b9%8e-draft-js-%e7%bc%96%e8%be%91%e5%99%a8%e7%9a%84%e5%ae%8c%e6%95%b4%e7%a0%b4%e8%a7%a3%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/95170.html","title":{"rendered":"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09"},"content":{"rendered":"<p>\u505a\u81ea\u52a8\u5316\u53d1\u5e03\u7684\u65f6\u5019&#xff0c;\u77e5\u4e4e\u662f\u6211\u5361\u5f97\u6700\u4e45\u7684\u4e00\u4e2a\u5e73\u53f0\u2014\u2014\u4e0d\u662f\u767b\u5f55\u3001\u4e0d\u662f\u98ce\u63a7&#xff0c;\u800c\u662f\u7f16\u8f91\u5668\u672c\u8eab\u628a\u6211\u62e6\u6b7b\u4e86\u3002<\/p>\n<p>\u9700\u6c42\u5f88\u7b80\u5355&#xff1a;\u628a Markdown \u6587\u7ae0\u81ea\u52a8\u53d1\u5230\u77e5\u4e4e\u3002\u7ed3\u679c\u5185\u5bb9\u600e\u4e48\u90fd\u8fdb\u4e0d\u53bb\u7f16\u8f91\u5668&#xff0c;\u63d0\u4ea4\u4e00\u6309&#xff0c;\u6b63\u6587\u662f\u7a7a\u7684\u3002\u524d\u524d\u540e\u540e\u6298\u817e\u4e86\u4e09\u4e2a\u5c0f\u65f6&#xff0c;\u6700\u540e\u53d1\u73b0\u6839\u5b50\u5728 React \u4e0a\u3002\u6574\u4e2a\u8fc7\u7a0b\u8bb0\u4e0b\u6765&#xff0c;\u7ed9\u540e\u6765\u7684\u4eba\u7701\u70b9\u65f6\u95f4\u3002<\/p>\n<h4>\u73b0\u8c61&#xff1a;\u5185\u5bb9\u585e\u8fdb\u53bb\u4e86&#xff0c;\u4e00\u63d0\u4ea4\u5c31\u4e22<\/h4>\n<p>\u4e00\u5f00\u59cb\u6211\u56fe\u7701\u4e8b&#xff0c;\u76f4\u63a5\u6539 DOM&#xff1a;<\/p>\n<p><span class=\"token keyword\">const<\/span> el <span class=\"token operator\">&#061;<\/span> document<span class=\"token punctuation\">.<\/span><span class=\"token function\">querySelector<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;.DraftEditor-root .public-DraftEditor-content&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nel<span class=\"token punctuation\">.<\/span>innerHTML <span class=\"token operator\">&#061;<\/span> contentHtml<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u9875\u9762\u4e0a\u770b\u7740\u660e\u660e\u663e\u793a\u51fa\u6765\u4e86&#xff0c;\u4e00\u70b9\u300c\u53d1\u5e03\u300d&#xff0c;\u6b63\u6587\u5374\u662f\u7a7a\u7684&#xff0c;\u6216\u8005\u53ea\u5269\u65e7\u5185\u5bb9\u3002\u4f60\u751a\u81f3\u80fd\u8089\u773c\u770b\u5230\u6587\u5b57\u4e00\u95ea&#xff0c;\u7136\u540e\u6ca1\u4e86\u3002<\/p>\n<h4>\u6839\u56e0&#xff1a;Draft.js \u662f React \u53d7\u63a7\u7ec4\u4ef6&#xff0c;\u5b83\u4e0d\u8ba4\u4f60\u7684 DOM<\/h4>\n<p>\u77e5\u4e4e\u7684\u7f16\u8f91\u5668\u5e95\u5c42\u662f Draft.js&#xff0c;\u8fd9\u662f React \u5b98\u65b9\u51fa\u7684\u5bcc\u6587\u672c\u6846\u67b6\u3002\u5b83\u5185\u90e8\u7ef4\u62a4\u7740\u4e00\u4efd\u81ea\u5df1\u7684 state&#xff08;\u7f16\u8f91\u72b6\u6001&#xff09;&#xff0c;\u9875\u9762\u4e0a\u7684\u6587\u5b57\u662f\u4ece\u8fd9\u4efd state \u6e32\u67d3\u51fa\u6765\u7684\u3002<\/p>\n<p>\u8fd9\u610f\u5473\u7740&#xff1a;\u4f60\u76f4\u63a5\u6539 innerHTML&#xff0c;\u6539\u7684\u662f\u6d4f\u89c8\u5668\u91cc\u6e32\u67d3\u51fa\u6765\u7684\u7ed3\u679c&#xff0c;\u4f46 React \u90a3\u4efd state \u538b\u6839\u6ca1\u53d8\u3002\u7b49\u4f60\u89e6\u53d1\u63d0\u4ea4&#xff0c;React \u7528\u81ea\u5df1 state \u91cd\u65b0\u6e32\u67d3&#xff0c;\u4f60\u585e\u8fdb\u53bb\u7684\u4e1c\u897f\u5c31\u5168\u88ab\u300c\u62b9\u300d\u56de\u53bb\u4e86\u3002<\/p>\n<p>\u6253\u4e2a\u6bd4\u65b9&#xff1a;\u4f60\u4ee5\u4e3a\u6539\u4e86\u8d26\u672c&#xff0c;\u5176\u5b9e\u4f60\u53ea\u662f\u62ff\u7b14\u5728\u8d26\u672c\u7684\u590d\u5370\u4ef6\u4e0a\u5199\u4e86\u5b57&#xff0c;\u539f\u4ef6\u4e00\u4e2a\u5b57\u6ca1\u52a8\u3002<\/p>\n<h4>\u7834\u89e3\u5173\u952e&#xff1a;\u522b\u8d70 DOM&#xff0c;\u8d70\u300c\u4e8b\u4ef6\u300d<\/h4>\n<p>React \u4e0d\u8ba4\u76f4\u63a5\u8d4b\u503c&#xff0c;\u4f46\u8ba4\u5408\u6210\u4e8b\u4ef6\u3002\u5b83\u76d1\u542c\u7684\u662f\u6d4f\u89c8\u5668\u7684\u8f93\u5165\u4e8b\u4ef6&#xff0c;\u800c\u4e0d\u662f DOM \u7684\u53d8\u5316\u3002\u6240\u4ee5\u6b63\u786e\u7684\u505a\u6cd5\u662f&#xff1a;\u6a21\u62df\u4e00\u6b21\u771f\u5b9e\u7684\u952e\u76d8\u8f93\u5165&#xff0c;\u8ba9 React \u81ea\u5df1\u628a\u8fd9\u7b14\u8f93\u5165\u8bb0\u8fdb state\u3002<\/p>\n<p><span class=\"token comment\">\/\/ \u5148\u8ba9\u7f16\u8f91\u5668\u83b7\u5f97\u7126\u70b9&#xff08;\u70b9\u51fb\u4e00\u4e0b&#xff09;<\/span><br \/>\n<span class=\"token keyword\">await<\/span> page<span class=\"token punctuation\">.<\/span><span class=\"token function\">click<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;.DraftEditor-root&#039;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u7528 insertText \u6a21\u62df\u952e\u76d8\u8f93\u5165&#xff0c;\u89e6\u53d1 React \u5408\u6210\u4e8b\u4ef6<\/span><br \/>\n<span class=\"token keyword\">await<\/span> page<span class=\"token punctuation\">.<\/span>keyboard<span class=\"token punctuation\">.<\/span><span class=\"token function\">insertText<\/span><span class=\"token punctuation\">(<\/span>content<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5c31\u8fd9\u4e00\u53e5 insertText()&#xff0c;\u628a innerHTML \u6362\u6210\u5b83&#xff0c;\u5185\u5bb9\u5c31\u8fdb\u53bb\u4e86&#xff0c;\u63d0\u4ea4\u4e5f\u4e0d\u4e22\u4e86\u3002<\/p>\n<h4>\u5b8c\u6574\u53ef\u8dd1\u901a\u7684\u4ee3\u7801<\/h4>\n<p>\u4e0b\u9762\u662f\u53d1\u5e03\u77e5\u4e4e\u6587\u7ae0\u7684\u5b8c\u6574\u7247\u6bb5&#xff08;Playwright &#043; Python&#xff09;&#xff1a;<\/p>\n<p><span class=\"token keyword\">from<\/span> playwright<span class=\"token punctuation\">.<\/span>sync_api <span class=\"token keyword\">import<\/span> sync_playwright<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">publish_zhihu<\/span><span class=\"token punctuation\">(<\/span>title<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">,<\/span> content<span class=\"token punctuation\">:<\/span> <span class=\"token builtin\">str<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">with<\/span> sync_playwright<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">as<\/span> p<span class=\"token punctuation\">:<\/span><br \/>\n        browser <span class=\"token operator\">&#061;<\/span> p<span class=\"token punctuation\">.<\/span>chromium<span class=\"token punctuation\">.<\/span>launch<span class=\"token punctuation\">(<\/span>headless<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">False<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u77e5\u4e4e\u53cd\u722c&#xff0c;\u5efa\u8bae headful<\/span><br \/>\n        page <span class=\"token operator\">&#061;<\/span> browser<span class=\"token punctuation\">.<\/span>new_page<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        page<span class=\"token punctuation\">.<\/span>goto<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;https:\/\/zhuanlan.zhihu.com\/write&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u586b\u6807\u9898<\/span><br \/>\n        page<span class=\"token punctuation\">.<\/span>fill<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;.WriteIndex-titleInput&#039;<\/span><span class=\"token punctuation\">,<\/span> title<span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u586b\u6b63\u6587&#xff1a;\u5148\u70b9\u7f16\u8f91\u5668\u83b7\u5f97\u7126\u70b9&#xff0c;\u518d\u6a21\u62df\u952e\u76d8\u8f93\u5165<\/span><br \/>\n        page<span class=\"token punctuation\">.<\/span>click<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;.DraftEditor-root&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        page<span class=\"token punctuation\">.<\/span>keyboard<span class=\"token punctuation\">.<\/span>insert_text<span class=\"token punctuation\">(<\/span>content<span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u70b9\u53d1\u5e03<\/span><br \/>\n        page<span class=\"token punctuation\">.<\/span>click<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;button:has-text(&#034;\u53d1\u5e03&#034;)&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        browser<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u51e0\u4e2a\u5173\u952e\u70b9&#xff1a;<\/p>\n<li>headless&#061;False\u2014\u2014\u77e5\u4e4e\u5bf9\u65e0\u5934\u6d4f\u89c8\u5668\u68c0\u6d4b\u5f88\u4e25&#xff0c;\u7528\u6709\u5934\u6a21\u5f0f\u6210\u529f\u7387\u9ad8\u5f97\u591a\u3002<\/li>\n<li>insert_text() \u662f\u6838\u5fc3&#xff0c;fill() \u5bf9 React \u53d7\u63a7\u7ec4\u4ef6\u7ecf\u5e38\u5931\u6548\u3002<\/li>\n<li>\u522b\u7528\u56fa\u5b9a sleep&#xff0c;\u7b49\u300c\u53d1\u5e03\u6210\u529f\u300d\u7684\u72b6\u6001\u5143\u7d20\u51fa\u73b0\u518d\u7ed3\u675f&#xff0c;\u6bd4\u778e\u7b49\u53ef\u9760\u3002<\/li>\n<h4>\u8fd9\u5957\u601d\u8def\u901a\u7528<\/h4>\n<p>\u51e1\u662f\u300c\u4f60\u6539\u4e86 DOM \u4f46\u9875\u9762\u4e0d\u8ba4\u300d\u7684\u573a\u666f&#xff0c;\u57fa\u672c\u90fd\u662f React \/ Vue \u8fd9\u7c7b\u6846\u67b6\u7684\u53d7\u63a7\u7ec4\u4ef6\u5728\u4f5c\u602a\u3002\u8bb0\u4f4f\u4e00\u6761&#xff1a;\u6846\u67b6\u7ef4\u62a4\u72b6\u6001\u7684\u573a\u666f&#xff0c;\u4e00\u5f8b\u8d70\u4e8b\u4ef6&#xff0c;\u4e0d\u8d70\u8d4b\u503c\u3002 \u77e5\u4e4e\u662f Draft.js&#xff0c;\u5176\u4ed6\u5e73\u53f0\u4e5f\u6709\u5404\u81ea\u7684\u5bcc\u6587\u672c\u6846\u67b6&#xff0c;\u601d\u8def\u90fd\u4e00\u6837\u3002<\/p>\n<hr \/>\n<p>\u505a\u6570\u636e\u91c7\u96c6\u3001\u81ea\u52a8\u5316\u811a\u672c\u3001\u591a\u5e73\u53f0\u53d1\u5e03\u7684\u670b\u53cb&#xff0c;\u5982\u679c\u4f60\u4e5f\u88ab\u67d0\u4e2a\u5e73\u53f0\u7684\u53cd\u722c\u5361\u4f4f\u4e86&#xff0c;\u6b22\u8fce\u6765\u627e\u6211\u804a\u804a\u3002<\/p>\n<p>\u63a5\u5355\u8303\u56f4&#xff1a;Python \u811a\u672c\u5b9a\u5236\u3001\u6570\u636e\u91c7\u96c6&#xff08;\u542b\u53cd\u722c\u7834\u89e3&#xff09;\u3001\u81ea\u52a8\u5316\u4ee3\u505a\u3001\u591a\u5e73\u53f0\u81ea\u52a8\u53d1\u5e03\u3002\u95f2\u9c7c\u76f4\u63a5\u641c\u300c\u53cd\u722c \u6570\u636e\u91c7\u96c6\u300d\u5c31\u80fd\u627e\u5230\u6211&#xff0c;\u6216\u8005 CSDN \u7ad9\u5185\u79c1\u4fe1&#xff0c;\u8bf4\u660e\u4f60\u7684\u9700\u6c42&#xff0c;\u6211\u770b\u5230\u4e86\u5c31\u56de\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u505a\u81ea\u52a8\u5316\u53d1\u5e03\u7684\u65f6\u5019&#xff0c;\u77e5\u4e4e\u662f\u6211\u5361\u5f97\u6700\u4e45\u7684\u4e00\u4e2a\u5e73\u53f0\u2014\u2014\u4e0d\u662f\u767b\u5f55\u3001\u4e0d\u662f\u98ce\u63a7&#xff0c;\u800c\u662f\u7f16\u8f91\u5668\u672c\u8eab\u628a\u6211\u62e6\u6b7b\u4e86\u3002<br \/>\n\u9700\u6c42\u5f88\u7b80\u5355&#xff1a;\u628a Markdown \u6587\u7ae0\u81ea\u52a8\u53d1\u5230\u77e5\u4e4e\u3002\u7ed3\u679c\u5185\u5bb9\u600e\u4e48\u90fd\u8fdb\u4e0d\u53bb\u7f16\u8f91\u5668&#xff0c;\u63d0\u4ea4\u4e00\u6309&#xff0c;\u6b63\u6587\u662f\u7a7a\u7684\u3002\u524d\u524d\u540e\u540e\u6298\u817e\u4e86\u4e09\u4e2a\u5c0f\u65f6&#xff0c;\u6700\u540e\u53d1\u73b0\u6839\u5b50\u5728 React \u4e0a\u3002\u6574\u4e2a\u8fc7\u7a0b\u8bb0\u4e0b\u6765&#xff0c;\u7ed9\u540e\u6765\u7684\u4eba\u7701\u70b9\u65f6\u95f4\u3002<br \/>\n\u73b0\u8c61&#xff1a;\u5185\u5bb9\u585e\u8fdb\u53bb\u4e86&#xff0c;\u4e00\u63d0\u4ea4\u5c31\u4e22<br \/>\n\u4e00\u5f00\u59cb\u6211\u56fe\u7701\u4e8b&amp;#xff0c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10910,2329,81,723,677],"topic":[],"class_list":["post-95170","post","type-post","status-publish","format-standard","hentry","category-server","tag-10910","tag-playwright","tag-python","tag-react","tag-677"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/95170.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u505a\u81ea\u52a8\u5316\u53d1\u5e03\u7684\u65f6\u5019&#xff0c;\u77e5\u4e4e\u662f\u6211\u5361\u5f97\u6700\u4e45\u7684\u4e00\u4e2a\u5e73\u53f0\u2014\u2014\u4e0d\u662f\u767b\u5f55\u3001\u4e0d\u662f\u98ce\u63a7&#xff0c;\u800c\u662f\u7f16\u8f91\u5668\u672c\u8eab\u628a\u6211\u62e6\u6b7b\u4e86\u3002 \u9700\u6c42\u5f88\u7b80\u5355&#xff1a;\u628a Markdown \u6587\u7ae0\u81ea\u52a8\u53d1\u5230\u77e5\u4e4e\u3002\u7ed3\u679c\u5185\u5bb9\u600e\u4e48\u90fd\u8fdb\u4e0d\u53bb\u7f16\u8f91\u5668&#xff0c;\u63d0\u4ea4\u4e00\u6309&#xff0c;\u6b63\u6587\u662f\u7a7a\u7684\u3002\u524d\u524d\u540e\u540e\u6298\u817e\u4e86\u4e09\u4e2a\u5c0f\u65f6&#xff0c;\u6700\u540e\u53d1\u73b0\u6839\u5b50\u5728 React \u4e0a\u3002\u6574\u4e2a\u8fc7\u7a0b\u8bb0\u4e0b\u6765&#xff0c;\u7ed9\u540e\u6765\u7684\u4eba\u7701\u70b9\u65f6\u95f4\u3002 \u73b0\u8c61&#xff1a;\u5185\u5bb9\u585e\u8fdb\u53bb\u4e86&#xff0c;\u4e00\u63d0\u4ea4\u5c31\u4e22 \u4e00\u5f00\u59cb\u6211\u56fe\u7701\u4e8b&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/95170.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-16T04:32:53+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95170.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/95170.html\",\"name\":\"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-16T04:32:53+00:00\",\"dateModified\":\"2026-08-16T04:32:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/95170.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/95170.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95170.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/95170.html","og_locale":"zh_CN","og_type":"article","og_title":"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u505a\u81ea\u52a8\u5316\u53d1\u5e03\u7684\u65f6\u5019&#xff0c;\u77e5\u4e4e\u662f\u6211\u5361\u5f97\u6700\u4e45\u7684\u4e00\u4e2a\u5e73\u53f0\u2014\u2014\u4e0d\u662f\u767b\u5f55\u3001\u4e0d\u662f\u98ce\u63a7&#xff0c;\u800c\u662f\u7f16\u8f91\u5668\u672c\u8eab\u628a\u6211\u62e6\u6b7b\u4e86\u3002 \u9700\u6c42\u5f88\u7b80\u5355&#xff1a;\u628a Markdown \u6587\u7ae0\u81ea\u52a8\u53d1\u5230\u77e5\u4e4e\u3002\u7ed3\u679c\u5185\u5bb9\u600e\u4e48\u90fd\u8fdb\u4e0d\u53bb\u7f16\u8f91\u5668&#xff0c;\u63d0\u4ea4\u4e00\u6309&#xff0c;\u6b63\u6587\u662f\u7a7a\u7684\u3002\u524d\u524d\u540e\u540e\u6298\u817e\u4e86\u4e09\u4e2a\u5c0f\u65f6&#xff0c;\u6700\u540e\u53d1\u73b0\u6839\u5b50\u5728 React \u4e0a\u3002\u6574\u4e2a\u8fc7\u7a0b\u8bb0\u4e0b\u6765&#xff0c;\u7ed9\u540e\u6765\u7684\u4eba\u7701\u70b9\u65f6\u95f4\u3002 \u73b0\u8c61&#xff1a;\u5185\u5bb9\u585e\u8fdb\u53bb\u4e86&#xff0c;\u4e00\u63d0\u4ea4\u5c31\u4e22 \u4e00\u5f00\u59cb\u6211\u56fe\u7701\u4e8b&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/95170.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-16T04:32:53+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/95170.html","url":"https:\/\/www.wsisp.com\/helps\/95170.html","name":"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-16T04:32:53+00:00","dateModified":"2026-08-16T04:32:53+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/95170.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/95170.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/95170.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u722c\u866b\u88ab React \u53cd\u722c\u62e6\u6b7b\uff1f\u77e5\u4e4e Draft.js \u7f16\u8f91\u5668\u7684\u5b8c\u6574\u7834\u89e3\u8fc7\u7a0b\uff08\u9644\u4ee3\u7801\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=95170"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95170\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=95170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=95170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=95170"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=95170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}