{"id":89015,"date":"2024-04-08T10:21:12","date_gmt":"2024-04-08T02:21:12","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/89015.html"},"modified":"2024-04-08T10:21:13","modified_gmt":"2024-04-08T02:21:13","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8react%e4%b8%ad%e4%bd%bf%e7%94%a8context%e6%9b%bf%e4%bb%a3redux","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/89015.html","title":{"rendered":"\u5982\u4f55\u5728React\u4e2d\u4f7f\u7528Context\u66ff\u4ee3Redux"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/02172843\/e0f15c30-9eec-4454-bb0e-d16c9e0eca0e.webp\" alt=\"\u5982\u4f55\u5728React\u4e2d\u4f7f\u7528Context\u66ff\u4ee3Redux\" \/><\/p>\n<p><p>\u5f53\u6d89\u53ca\u5230React\u5e94\u7528\u7a0b\u5e8f\u7684\u72b6\u6001\u7ba1\u7406\u65f6\uff0c<strong>Context API<\/strong>\u53ef\u4ee5\u6210\u4e3a\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u76f8\u5bf9\u4e8e\u4f7f\u7528<strong>Redux<\/strong>\u800c\u8a00\uff0c\u5b83\u53ef\u4ee5\u63d0\u4f9b\u66f4\u7b80\u6613\u7684\u72b6\u6001\u5171\u4eab\u65b9\u5f0f\u3002<strong>Context API \u5141\u8bb8\u5f00\u53d1\u8005\u8de8\u7ec4\u4ef6\u5c42\u7ea7\u76f4\u63a5\u4f20\u9012\u6570\u636e\uff0c\u65e0\u9700\u901a\u8fc7\u6bcf\u4e2a\u5c42\u7ea7\u624b\u52a8\u4f20\u9012props<\/strong>\u3002\u8fd9\u6837\uff0c\u5bf9\u4e8e\u5c0f\u5230\u4e2d\u578b\u7684\u5e94\u7528\u6216\u662f\u90a3\u4e9b\u9700\u8981\u7b80\u7b80\u5355\u5355\u7684\u72b6\u6001\u7ba1\u7406\u7684\u9879\u76ee\u800c\u8a00\uff0c\u5b83\u662f\u4e00\u4e2a\u66f4\u4e3a\u76f4\u63a5\u4e14\u9ad8\u6548\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><p>Redux\u901a\u8fc7\u96c6\u4e2d\u5b58\u50a8\u6765\u7ba1\u7406\u5e94\u7528\u7684\u72b6\u6001\uff0c\u5e76\u5c06\u72b6\u6001\u53d8\u5316\u9650\u5236\u5728\u4e25\u683c\u5b9a\u4e49\u7684actions\u548creducers\u4e2d\uff0c\u8fd9\u79cd\u65b9\u5f0f\u5bf9\u4e8e\u5927\u578b\u590d\u6742\u7684\u5e94\u7528\u662f\u975e\u5e38\u9002\u5408\u7684\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u4e00\u4e9b\u5c0f\u578b\u9879\u76ee\u6765\u8bf4\uff0c\u8fd9\u79cd\u96c6\u4e2d\u5f0f\u72b6\u6001\u7ba1\u7406\u53ef\u80fd\u663e\u5f97\u6709\u4e9b\u8fc7\u4e8e\u590d\u6742\uff0c\u800cContext API\u5219\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7b80\u4fbf\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001CONTEXT API \u7b80\u4ecb<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u8981\u4e86\u89e3\u5982\u4f55\u5728React\u4e2d\u4f7f\u7528Context API\uff0c\u5fc5\u987b\u5148\u660e\u767dContext API\u672c\u8eab\u7684\u6838\u5fc3\u6982\u5ff5\u3002Context API \u662fReact\u6846\u67b6\u81ea\u8eab\u63d0\u4f9b\u7684\u4e00\u79cd\u72b6\u6001\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u8ba9\u6570\u636e\u5728\u7ec4\u4ef6\u6811\u4e2d\u7a7f\u884c\uff0c\u907f\u514d\u4e86\u5728\u6bcf\u4e2a\u7ec4\u4ef6\u5c42\u624b\u52a8\u4f20\u9012props\u3002<\/p>\n<\/p>\n<p><h4>Context API\u7684\u7528\u6cd5<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Context API\u9700\u8981\u4e09\u4e2a\u4e3b\u8981\u6b65\u9aa4\uff1a\u521b\u5efa\u4e00\u4e2aContext\u3001\u4f7f\u7528Provider\u63d0\u4f9b\u6570\u636e\u3001\u4f7f\u7528Consumer\u6216<code>useContext<\/code>\u94a9\u5b50\u6765\u8bfb\u53d6\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>\u521b\u5efaContext<\/h4>\n<\/p>\n<p><pre><code class=\"language-jsx\">import React from &#039;react&#039;;<\/p>\n<p>const MyContext = React.createContext(defaultValue);<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Context\u5bf9\u8c61\u7684\u521b\u5efa\u662f\u901a\u8fc7<code>React.createContext<\/code>\u5b8c\u6210\u7684\uff0c<code>defaultValue<\/code>\u662f\u4e00\u4e2a\u5bf9\u4e8e\u9ed8\u8ba4\u6570\u636e\u7684\u5f15\u7528\uff0c\u5b83\u4f1a\u5728\u7ec4\u4ef6\u6811\u4e2d\u6ca1\u6709\u5339\u914d\u5230Provider\u65f6\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001PROVIDER AND CONSUMER<\/h3>\n<\/p>\n<p><h4>\u4f7f\u7528Provider\u6ce8\u5165\u6570\u636e<\/h4>\n<\/p>\n<p><p>Provider\u5141\u8bb8\u5c06\u6570\u636e\u6ce8\u5165\u5230\u7ec4\u4ef6\u6811\u4e2d\u3002\u4efb\u4f55\u5728Provider\u7ec4\u4ef6\u5185\u7684\u5b50\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u8bbf\u95ee\u5230Provider\u7684value\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-jsx\">&lt;MyContext.Provider value={\/* some value *\/}&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u4f7f\u7528Consumer\u6216useContext\u8bfb\u53d6\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u8981\u8bfb\u53d6Provider\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u5728\u51fd\u6570\u7ec4\u4ef6\u4e2d\u4f7f\u7528<code>useContext<\/code>\u94a9\u5b50\uff0c\u6216\u8005\u5728\u7c7b\u7ec4\u4ef6\u4e2d\u4f7f\u7528<code>&lt;MyContext.Consumer&gt;<\/code>\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-jsx\">const value = useContext(MyContext);<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-jsx\">&lt;MyContext.Consumer&gt;<\/p>\n<p>  {value =&gt; \/* render something based on the context value *\/}<\/p>\n<p>&lt;\/MyContext.Consumer&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001CONTEXT VS REDUX<\/h3>\n<\/p>\n<p><p>\u4e3a\u4ec0\u4e48\u9009\u62e9Context\u800c\u4e0d\u662fRedux? Context API\u5728React 16.3\u7248\u4e2d\u5f97\u5230\u4e86\u6539\u8fdb\uff0c\u5176\u5728\u6027\u80fd\u548c\u53ef\u7528\u6027\u4e0a\u90fd\u6709\u4e86\u663e\u8457\u63d0\u5347\u3002<\/p>\n<\/p>\n<p><p><strong>Context API\u4f18\u70b9<\/strong>:<\/p>\n<\/p>\n<ul>\n<li><strong>\u7b80\u5316\u4e86\u72b6\u6001\u5171\u4eab<\/strong>\uff1aContext API\u5141\u8bb8\u72b6\u6001\u5728\u7ec4\u4ef6\u95f4\u76f4\u63a5\u5171\u4eab\uff0c\u7701\u53bb\u4e86\u624b\u52a8\u4e0b\u4f20props\u7684\u9ebb\u70e6\u3002<\/li>\n<li><strong>\u51cf\u5c11\u4e86\u4ee3\u7801\u590d\u6742\u5ea6<\/strong>\uff1a\u4e0eRedux\u76f8\u6bd4\uff0cContext API\u7684\u5f15\u5165\uff0c\u51cf\u5c11\u4e86\u8981\u5199\u7684boilerplate\u4ee3\u7801\u91cf\u3002<\/li>\n<li><strong>\u66f4\u597d\u7684\u6027\u80fd<\/strong>\uff1a\u5bf9\u4e8e\u5c0f\u578b\u5e94\u7528\u6765\u8bf4\uff0c\u7531\u4e8e\u5b83\u7684\u8f7b\u91cf\u548c\u7b80\u6d01\uff0cContext API\u5f80\u5f80\u80fd\u63d0\u4f9b\u66f4\u597d\u7684\u6027\u80fd\u3002<\/li>\n<\/ul>\n<p><p><strong>Redux\u4f18\u70b9<\/strong>:<\/p>\n<\/p>\n<ul>\n<li><strong>\u53ef\u9884\u6d4b\u7684\u72b6\u6001\u66f4\u65b0<\/strong>\uff1aRedux\u901a\u8fc7\u96c6\u4e2d\u7684store\u548c\u7eaf\u51fd\u6570reducers\u6765\u63a7\u5236\u72b6\u6001\u53d8\u5316\uff0c\u4f7f\u5176\u53d8\u5f97\u53ef\u9884\u6d4b\u4e14\u6613\u4e8e\u8ffd\u8e2a\u3002<\/li>\n<li><strong>\u652f\u6301\u4e2d\u95f4\u4ef6\u548c\u5f3a\u5927\u7684\u5f00\u53d1\u5de5\u5177<\/strong>\uff1aRedux\u53ef\u63d2\u62d4\u7684\u4e2d\u95f4\u4ef6\u548c\u65f6\u95f4\u65c5\u884c\u8c03\u8bd5\u5de5\u5177\u5bf9\u4e8e\u590d\u6742\u5e94\u7528\u5f00\u53d1\u975e\u5e38\u6709\u5e2e\u52a9\u3002<\/li>\n<li><strong>\u793e\u533a\u548c\u751f\u6001\u7cfb\u7edf\u7a33\u5b9a<\/strong>\uff1aRedux\u5df2\u7ecf\u88ab\u5e7f\u6cdb\u4f7f\u7528\uff0c\u62e5\u6709\u6210\u719f\u7684\u793e\u533a\u3001\u4e30\u5bcc\u7684\u8d44\u6e90\u548c\u4e2d\u95f4\u4ef6\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u5982\u4f55\u5728React\u4e2d\u4f7f\u7528Context\u66ff\u4ee3Redux<\/h3>\n<\/p>\n<p><p>\u82e5\u8981\u5728React\u4e2d\u4f7f\u7528Context API\u66ff\u4ee3Redux\uff0c\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h4>\u72b6\u6001\u7ba1\u7406\u67b6\u6784<\/h4>\n<\/p>\n<p><p>\u8bbe\u8ba1\u597d\u6574\u4f53\u7684\u72b6\u6001\u5b58\u653e\u67b6\u6784\u53ca\u5176\u66f4\u65b0\u903b\u8f91\u662f\u975e\u5e38\u5173\u952e\u7684\uff0c\u5e94\u4e0eRedux\u4e2d\u7684Store\u7c7b\u4f3c\u3002<\/p>\n<\/p>\n<p><h4>\u521b\u5efaContext\u548cProvider<\/h4>\n<\/p>\n<p><pre><code class=\"language-jsx\">const StoreContext = React.createContext(null);<\/p>\n<p>const StoreProvider = ({ children }) =&gt; {<\/p>\n<p>  const [state, setState] = useState(initialState);<\/p>\n<p>  \/\/ \u67d0\u79cd\u5f62\u5f0f\u7684dispatch\u51fd\u6570\uff0c\u7528\u4e8e\u66f4\u65b0\u72b6\u6001<\/p>\n<p>  const dispatch = (action) =&gt; {<\/p>\n<p>    \/\/ ...\u5904\u7406action\u5e76\u66f4\u65b0\u72b6\u6001<\/p>\n<p>  };<\/p>\n<p>  return &lt;StoreContext.Provider value={{ state, dispatch }}&gt;{children}&lt;\/StoreContext.Provider&gt;;<\/p>\n<p>};<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u5728\u5b50\u7ec4\u4ef6\u4e2d\u4f7f\u7528Context<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528<code>useContext<\/code>\u94a9\u5b50\u6216\u8005<code>&lt;StoreContext.Consumer&gt;<\/code>\u6765\u8bbf\u95eeContext\u4e2d\u7684\u6570\u636e\u548c\u66f4\u65b0\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><h4>\u8fc1\u79fbRedux\u4e2d\u7684Action\u548cReducer<\/h4>\n<\/p>\n<p><p>\u5c06Redux\u7684action creators\u548creducers\u8fc1\u79fb\u5230\u4f7f\u7528Context\u7684\u65b9\u5f0f\u4e2d\uff0c\u66f4\u65b0\u72b6\u6001\u4f1a\u901a\u8fc7\u65b0\u7684<code>dispatch<\/code>\u51fd\u6570\u6765\u5b8c\u6210\u3002<\/p>\n<\/p>\n<p><h4>\u6027\u80fd\u4f18\u5316<\/h4>\n<\/p>\n<p><p>Context API\u7684\u4e00\u4e2a\u6f5c\u5728\u95ee\u9898\u662f\uff0c\u5f53Context\u503c\u53d8\u5316\u65f6\uff0c\u6240\u6709\u6d88\u8d39\u8005\u7ec4\u4ef6\u90fd\u4f1a\u91cd\u65b0\u6e32\u67d3\u3002\u8fd9\u91cc\u53ef\u4ee5\u901a\u8fc7\u591a\u4e2aContexts\u7684\u7ec4\u5408\uff0c\u6216\u8005\u4f7f\u7528<code>useMemo<\/code>\u548c<code>React.memo<\/code>\u7ec4\u4ef6\u6765\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u6e32\u67d3\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5b9e\u9645\u6848\u4f8b<\/h3>\n<\/p>\n<p><p>\u5728\u5177\u4f53\u7684\u9879\u76ee\u4e2d\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u7279\u5b9a\u7684Context\u6765\u7ba1\u7406\u5e94\u7528\u4e2d\u7684\u4e0d\u540c\u90e8\u5206\u7684\u72b6\u6001\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u7528\u6237\u8ba4\u8bc1\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2aAuthContext\uff1b\u5bf9\u4e8e\u4e00\u4e2a\u7535\u5b50\u5546\u52a1\u7f51\u7ad9\u7684\u8d2d\u7269\u8f66\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2aCartContext\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u7ed3\u8bba<\/h3>\n<\/p>\n<p><p>\u867d\u7136Redux\u5728\u5927\u578b\u5e94\u7528\u4e2d\u7684\u6df1\u5165\u6027\u548c\u4e2d\u95f4\u4ef6\u652f\u6301\u4ecd\u7136\u662fContext API\u65e0\u6cd5\u6bd4\u62df\u7684\uff0c\u4f46\u5bf9\u4e8e\u9700\u8981\u66f4\u5feb\u901f\u5f00\u53d1\u548c\u8f83\u4e3a\u7b80\u6d01\u7684\u9879\u76ee\uff0cContext API\u662f\u4e00\u4e2a\u975e\u5e38\u597d\u7684\u66ff\u6362\u9009\u62e9\u3002\u5b83\u4e0d\u4ec5\u80fd\u591f<strong>\u63d0\u4f9b\u8db3\u591f\u7684\u529f\u80fd\u4ee5\u652f\u6301\u72b6\u6001\u7ba1\u7406\u9700\u6c42<\/strong>\uff0c\u8fd8\u80fd\u591f\u5728<strong>\u51cf\u5c11\u9879\u76ee\u590d\u6742\u5ea6\u7684\u540c\u65f6<\/strong>\u4fdd\u6301\u8f83\u9ad8\u7684\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u5982\u4f55\u5728React\u4e2d\u4f7f\u7528Context\u6765\u7ba1\u7406\u72b6\u6001\uff1f<\/strong><\/p>\n<p>\u5728React\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Context\u6765\u5c06\u72b6\u6001\u4f20\u9012\u7ed9\u7ec4\u4ef6\u6811\u4e2d\u7684\u591a\u4e2a\u7ec4\u4ef6\uff0c\u800c\u4e0d\u5fc5\u4f7f\u7528Redux\u3002\u8981\u4f7f\u7528Context\u6765\u7ba1\u7406\u72b6\u6001\uff0c\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2aContext\u5bf9\u8c61\uff0c\u7136\u540e\u5c06\u5176\u5305\u88c5\u5728\u4e00\u4e2a\u63d0\u4f9b\u5668\u7ec4\u4ef6\u4e2d\u3002\u63d0\u4f9b\u5668\u7ec4\u4ef6\u53ef\u4ee5\u5728\u5176props\u4e2d\u63d0\u4f9b\u72b6\u6001\u503c\uff0c\u5e76\u5c06\u5176\u901a\u8fc7Context\u4f20\u9012\u7ed9\u5b50\u7ec4\u4ef6\u3002\u5b50\u7ec4\u4ef6\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Context\u7684\u6d88\u8d39\u8005\u7ec4\u4ef6\u8bbf\u95ee\u72b6\u6001\u503c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728React\u7ec4\u4ef6\u4e2d\u8ba2\u9605Context\u7684\u53d8\u5316\uff1f<\/strong><\/p>\n<p>\u8981\u5728React\u7ec4\u4ef6\u4e2d\u8ba2\u9605Context\u7684\u53d8\u5316\uff0c\u9996\u5148\u9700\u8981\u5c06\u7ec4\u4ef6\u5305\u88c5\u5728Context\u7684\u6d88\u8d39\u8005\u7ec4\u4ef6\u4e2d\u3002\u6d88\u8d39\u8005\u7ec4\u4ef6\u7684Render Props\u5c5e\u6027\u53ef\u4ee5\u63a5\u6536\u6765\u81eaContext\u7684\u503c\uff0c\u5e76\u5c06\u5176\u4f20\u9012\u7ed9\u5d4c\u5957\u5728Render Props\u4e2d\u7684\u5b50\u7ec4\u4ef6\u3002\u5f53Context\u7684\u503c\u53d1\u751f\u53d8\u5316\u65f6\uff0c\u6d88\u8d39\u8005\u7ec4\u4ef6\u4f1a\u91cd\u65b0\u6e32\u67d3\uff0c\u5e76\u5c06\u65b0\u503c\u4f20\u9012\u7ed9\u5b50\u7ec4\u4ef6\u3002\u8fd9\u6837\uff0c\u5b50\u7ec4\u4ef6\u5c31\u53ef\u4ee5\u5728Context\u503c\u53d1\u751f\u53d8\u5316\u65f6\u54cd\u5e94\u5e76\u66f4\u65b0\u81ea\u8eab\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728React\u4e2d\u5b9e\u73b0\u7c7b\u4f3cRedux\u7684\u4e2d\u95f4\u4ef6\u529f\u80fd\uff1f<\/strong><\/p>\n<p>\u5728React\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Context\u6765\u5b9e\u73b0\u7c7b\u4f3cRedux\u7684\u4e2d\u95f4\u4ef6\u529f\u80fd\u3002\u4e2d\u95f4\u4ef6\u662f\u4e00\u4e2a\u5728\u6d3e\u53d1action\u548creducer\u4e4b\u95f4\u6267\u884c\u7684\u51fd\u6570\uff0c\u5b83\u53ef\u4ee5\u62e6\u622a\u5e76\u5904\u7406action\uff0c\u7136\u540e\u518d\u5c06\u5176\u4f20\u9012\u7ed9reducer\u3002\u8981\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\uff0c\u53ef\u4ee5\u5728Context\u7684\u63d0\u4f9b\u5668\u7ec4\u4ef6\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u6d3e\u53d1\u51fd\u6570\u548c\u4e00\u4e2a\u4e2d\u95f4\u4ef6\u6570\u7ec4\u3002\u5f53\u6d3e\u53d1\u51fd\u6570\u88ab\u8c03\u7528\u65f6\uff0c\u4e2d\u95f4\u4ef6\u6570\u7ec4\u4e2d\u7684\u51fd\u6570\u4f1a\u6309\u987a\u5e8f\u6267\u884c\uff0c\u5e76\u6700\u7ec8\u8c03\u7528\u771f\u6b63\u7684reducer\u51fd\u6570\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3cRedux\u4e2d\u95f4\u4ef6\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u5f02\u6b65\u64cd\u4f5c\u548c\u65e5\u5fd7\u8bb0\u5f55\u7b49\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5f53\u6d89\u53ca\u5230React\u5e94\u7528\u7a0b\u5e8f\u7684\u72b6\u6001\u7ba1\u7406\u65f6\uff0cContext API\u53ef\u4ee5\u6210\u4e3a\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u76f8\u5bf9\u4e8e\u4f7f\u7528Redu [&hellip;]","protected":false},"author":3,"featured_media":89017,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/89015"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=89015"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/89015\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/89017"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=89015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=89015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=89015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}