{"id":36056,"date":"2025-05-07T15:51:58","date_gmt":"2025-05-07T07:51:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/36056.html"},"modified":"2025-05-07T15:51:58","modified_gmt":"2025-05-07T07:51:58","slug":"30%e3%80%81vuex-%e4%b8%ba%e5%95%a5%e5%8f%af%e4%bb%a5%e8%bf%9b%e8%a1%8c%e7%bc%93%e5%ad%98%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/36056.html","title":{"rendered":"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406"},"content":{"rendered":"<li>\n<p>Vuex \u72b6\u6001\u7ba1\u7406\u57fa\u7840\u4e0e\u7f13\u5b58\u7684\u5173\u8054<\/p>\n<ul>\n<li>\n<p>Vuex \u7684\u6838\u5fc3\u6982\u5ff5&#xff1a;<\/p>\n<ul>\n<li>Vuex \u4e3b\u8981\u7531\u4e94\u4e2a\u90e8\u5206\u7ec4\u6210&#xff1a;state\u3001mutations\u3001actions\u3001getters\u548cmodules\u3002\u5176\u4e2d&#xff0c;state\u662f\u5b58\u50a8\u6570\u636e\u7684\u5730\u65b9&#xff0c;\u7c7b\u4f3c\u4e8e\u4e00\u4e2a\u5168\u5c40\u7684\u6570\u636e\u4ed3\u5e93\u3002\u5728\u8fd9\u4e2a\u83dc\u8c31 APP \u7684\u4f8b\u5b50\u4e2d&#xff0c;\u7f13\u5b58\u7684\u6570\u636e\u5c31\u5b58\u50a8\u5728state\u4e2d\u3002<\/li>\n<li>\u4f8b\u5982&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5728state\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u5bf9\u8c61\u6765\u5b58\u50a8\u83dc\u8c31\u54c1\u7c7b\u548c\u83dc\u8c31\u7684\u6570\u636e&#xff0c;\u50cf\u8fd9\u6837&#xff1a;\n<p>javascript<\/p>\n<p> const state &#061; {<br \/>\n  recipeCache: {}<br \/>\n};<br \/>\n  \u8fd9\u91cc\u7684recipeCache\u5c31\u662f\u7528\u6765\u7f13\u5b58\u83dc\u8c31\u76f8\u5173\u6570\u636e\u7684\u5bf9\u8c61&#xff0c;\u4ee5\u54c1\u7c7b\u4e0b\u6807\u4f5c\u4e3a\u952e&#xff0c;\u5bf9\u5e94\u7684\u83dc\u8c31\u6570\u636e\u4f5c\u4e3a\u503c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7ec4\u4ef6\u4e0e Vuex \u6570\u636e\u7684\u4ea4\u4e92&#xff1a;<\/p>\n<ul>\n<li>\u7ec4\u4ef6\u53ef\u4ee5\u901a\u8fc7mapState\u3001mapGetters\u7b49\u8f85\u52a9\u51fd\u6570\u6765\u83b7\u53d6state\u4e2d\u7684\u6570\u636e\u3002\u8fd9\u6837&#xff0c;\u4e0d\u540c\u7684\u7ec4\u4ef6&#xff08;\u5982\u5de6\u8fb9\u7684\u83dc\u8c31\u54c1\u7c7b\u5c55\u793a\u7ec4\u4ef6\u548c\u53f3\u8fb9\u7684\u83dc\u8c31\u5c55\u793a\u7ec4\u4ef6&#xff09;\u90fd\u80fd\u591f\u8bbf\u95ee\u548c\u4f7f\u7528\u5b58\u50a8\u5728state\u4e2d\u7684\u7f13\u5b58\u6570\u636e\u3002<\/li>\n<li>\u6bd4\u5982&#xff0c;\u5728\u4e00\u4e2a\u7ec4\u4ef6\u4e2d&#xff0c;\u6211\u4eec\u53ef\u4ee5\u8fd9\u6837\u83b7\u53d6\u7f13\u5b58\u7684\u83dc\u8c31\u6570\u636e&#xff1a;\n<p>javascript<\/p>\n<p> import { mapState } from &#039;vuex&#039;;<br \/>\nexport default {<br \/>\n  computed: {<br \/>\n   &#8230;mapState([&#039;recipeCache&#039;])<br \/>\n  }<br \/>\n};<br \/>\n  \u8fd9\u4f7f\u5f97\u7ec4\u4ef6\u80fd\u591f\u65b9\u4fbf\u5730\u83b7\u53d6recipeCache\u4e2d\u7684\u6570\u636e&#xff0c;\u5e76\u6839\u636e\u8fd9\u4e9b\u6570\u636e\u8fdb\u884c\u6e32\u67d3\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u5904\u7406\u7684\u5177\u4f53\u5b9e\u73b0\u4e0e\u4f18\u52bf<\/p>\n<ul>\n<li>\n<p>\u51cf\u5c11\u63a5\u53e3\u8c03\u7528\u6b21\u6570&#xff1a;<\/p>\n<ul>\n<li>\u6700\u521d&#xff0c;\u6bcf\u6b21\u5207\u6362\u83dc\u8c31\u54c1\u7c7b\u65f6&#xff0c;\u90fd\u4f1a\u8c03\u7528\u63a5\u53e3\u83b7\u53d6\u6570\u636e\u3002\u6709\u4e86 Vuex \u7f13\u5b58\u540e&#xff0c;\u5728\u83b7\u53d6\u6570\u636e\u4e4b\u524d&#xff0c;\u53ef\u4ee5\u5148\u68c0\u67e5state\u4e2d\u7684recipeCache\u5bf9\u8c61\u662f\u5426\u5df2\u7ecf\u5b58\u5728\u5bf9\u5e94\u7684\u54c1\u7c7b\u6570\u636e\u3002<\/li>\n<li>\u4f8b\u5982&#xff0c;\u6709\u4e00\u4e2a\u65b9\u6cd5\u7528\u4e8e\u83b7\u53d6\u83dc\u8c31\u6570\u636e&#xff0c;\u6539\u9020\u540e\u7684\u4ee3\u7801\u53ef\u80fd\u5982\u4e0b&#xff1a;\n<p>javascript<\/p>\n<p> async getRecipeData(categoryIndex) {<br \/>\n  if (this.$store.state.recipeCache[categoryIndex]) {<br \/>\n    return this.$store.state.recipeCache[categoryIndex];<br \/>\n  }<br \/>\n  \/\/ \u5982\u679c\u7f13\u5b58\u4e2d\u6ca1\u6709\u6570\u636e&#xff0c;\u5219\u8c03\u7528\u63a5\u53e3\u83b7\u53d6<br \/>\n  const data &#061; await api.getRecipeData(categoryIndex);<br \/>\n  this.$store.commit(&#039;setRecipeData&#039;, { categoryIndex, data });<br \/>\n  return data;<br \/>\n}<br \/>\n  \u8fd9\u91cc\u901a\u8fc7\u5224\u65adrecipeCache\u4e2d\u662f\u5426\u5b58\u5728\u6570\u636e\u6765\u51b3\u5b9a\u662f\u5426\u8c03\u7528\u63a5\u53e3&#xff0c;\u4ece\u800c\u907f\u514d\u4e86\u4e0d\u5fc5\u8981\u7684\u63a5\u53e3\u8c03\u7528&#xff0c;\u51cf\u5c11\u4e86\u6027\u80fd\u6d88\u8017\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6570\u636e\u5171\u4eab\u4e0e\u4e00\u81f4\u6027&#xff1a;<\/p>\n<ul>\n<li>\u7531\u4e8e Vuex \u7684state\u662f\u5168\u5c40\u5171\u4eab\u7684&#xff0c;\u591a\u4e2a\u7ec4\u4ef6\u53ef\u4ee5\u8bbf\u95ee\u76f8\u540c\u7684\u7f13\u5b58\u6570\u636e\u3002\u8fd9\u786e\u4fdd\u4e86\u6574\u4e2a\u5e94\u7528\u4e2d\u83dc\u8c31\u6570\u636e\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<li>\u6bd4\u5982&#xff0c;\u5de6\u8fb9\u7684\u83dc\u8c31\u54c1\u7c7b\u7ec4\u4ef6\u548c\u53f3\u8fb9\u7684\u83dc\u8c31\u5c55\u793a\u7ec4\u4ef6\u90fd\u53ef\u4ee5\u8bbf\u95eerecipeCache\u4e2d\u7684\u6570\u636e\u3002\u5f53\u5de6\u8fb9\u7ec4\u4ef6\u5207\u6362\u54c1\u7c7b\u65f6&#xff0c;\u53f3\u8fb9\u7ec4\u4ef6\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u66f4\u65b0\u540e\u7684\u7f13\u5b58\u6570\u636e\u8fdb\u884c\u6e32\u67d3&#xff0c;\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u83b7\u53d6\u6570\u636e&#xff0c;\u4fdd\u8bc1\u4e86\u6570\u636e\u5728\u4e0d\u540c\u7ec4\u4ef6\u4e4b\u95f4\u7684\u540c\u6b65\u548c\u5171\u4eab\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5f15\u7528\u7c7b\u578b\u95ee\u9898\u53ca\u6df1\u590d\u5236\u89e3\u51b3\u65b9\u6848<\/p>\n<ul>\n<li>\n<p>\u5f15\u7528\u7c7b\u578b\u5728\u54cd\u5e94\u5f0f\u7cfb\u7edf\u4e2d\u7684\u6311\u6218&#xff1a;<\/p>\n<ul>\n<li>\u5728 JavaScript \u4e2d&#xff0c;\u5bf9\u8c61\u548c\u6570\u7ec4\u662f\u5f15\u7528\u6570\u636e\u7c7b\u578b\u3002\u5728 Vue \u7684\u54cd\u5e94\u5f0f\u7cfb\u7edf\u4e2d&#xff0c;\u5982\u679c\u53ea\u662f\u4fee\u6539\u4e86\u5f15\u7528\u6570\u636e\u7c7b\u578b\u5185\u90e8\u7684\u5c5e\u6027&#xff0c;\u800c\u6ca1\u6709\u6539\u53d8\u6570\u636e\u7684\u5f15\u7528\u5730\u5740&#xff0c;Vue \u53ef\u80fd\u65e0\u6cd5\u68c0\u6d4b\u5230\u6570\u636e\u7684\u53d8\u5316\u3002<\/li>\n<li>\u4f8b\u5982&#xff0c;\u5728recipeCache\u4e2d\u5b58\u50a8\u7684\u83dc\u8c31\u6570\u636e\u662f\u4e00\u4e2a\u5bf9\u8c61\u3002\u5982\u679c\u76f4\u63a5\u4fee\u6539\u8fd9\u4e2a\u5bf9\u8c61\u7684\u67d0\u4e2a\u5c5e\u6027&#xff0c;\u50cf\u8fd9\u6837&#xff1a;\n<p>javascript<\/p>\n<p> this.$store.state.recipeCache[categoryIndex].recipeName &#061; &#039;\u65b0\u83dc\u8c31\u540d\u79f0&#039;;<br \/>\n  Vue \u53ef\u80fd\u4e0d\u4f1a\u89e6\u53d1\u7ec4\u4ef6\u7684\u66f4\u65b0&#xff0c;\u56e0\u4e3a\u6570\u636e\u7684\u5f15\u7528\u5730\u5740\u6ca1\u6709\u6539\u53d8\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6df1\u590d\u5236\u7684\u539f\u7406\u4e0e\u5e94\u7528&#xff1a;<\/p>\n<ul>\n<li>\u6df1\u590d\u5236\u662f\u521b\u5efa\u4e00\u4e2a\u5168\u65b0\u7684\u5bf9\u8c61&#xff0c;\u5b83\u7684\u6240\u6709\u5c5e\u6027\u548c\u5b50\u5c5e\u6027\u90fd\u662f\u539f\u59cb\u5bf9\u8c61\u7684\u526f\u672c\u3002\u5728mutation\u4e2d\u8fdb\u884c\u6df1\u590d\u5236&#xff0c;\u53ef\u4ee5\u786e\u4fdd\u6bcf\u6b21\u66f4\u65b0\u6570\u636e\u65f6&#xff0c;\u6570\u636e\u7684\u5f15\u7528\u5730\u5740\u53d1\u751f\u53d8\u5316&#xff0c;\u4ece\u800c\u89e6\u53d1 Vue \u7684\u54cd\u5e94\u5f0f\u66f4\u65b0\u3002<\/li>\n<li>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2amutation\u7528\u4e8e\u66f4\u65b0recipeCache\u4e2d\u7684\u6570\u636e&#xff0c;\u53ef\u80fd\u4f1a\u8fd9\u6837\u505a&#xff1a;\n<p>javascript<\/p>\n<p> mutations: {<br \/>\n  setRecipeData(state, { categoryIndex, data }) {<br \/>\n    \/\/ \u4f7f\u7528\u6df1\u590d\u5236\u5e93&#xff08;\u5982lodash\u7684cloneDeep&#xff09;<br \/>\n    const newData &#061; _.cloneDeep(data);<br \/>\n    state.recipeCache[categoryIndex] &#061; newData;<br \/>\n  }<br \/>\n}<br \/>\n  \u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f&#xff0c;\u6bcf\u6b21\u66f4\u65b0\u6570\u636e\u65f6&#xff0c;\u90fd\u4f1a\u5c06\u5168\u65b0\u7684\u6570\u636e\u526f\u672c\u8d4b\u503c\u7ed9recipeCache&#xff0c;\u4f7f\u5f97 Vue \u80fd\u591f\u6b63\u786e\u5730\u68c0\u6d4b\u5230\u6570\u636e\u7684\u53d8\u5316\u5e76\u66f4\u65b0\u7ec4\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7f13\u5b58\u6e05\u9664\u4e0e\u751f\u547d\u5468\u671f\u94a9\u5b50\u7684\u914d\u5408<\/p>\n<ul>\n<li>\n<p>\u7f13\u5b58\u6e05\u9664\u7684\u539f\u56e0&#xff1a;<\/p>\n<ul>\n<li>\u867d\u7136\u7f13\u5b58\u6570\u636e\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd&#xff0c;\u4f46\u5982\u679c\u540e\u53f0\u6570\u636e\u53d1\u751f\u53d8\u5316&#xff0c;\u800c\u7f13\u5b58\u6ca1\u6709\u66f4\u65b0&#xff0c;\u9875\u9762\u5c06\u663e\u793a\u65e7\u7684\u6570\u636e\u3002\u56e0\u6b64&#xff0c;\u9700\u8981\u5728\u9002\u5f53\u7684\u65f6\u5019\u6e05\u9664\u7f13\u5b58&#xff0c;\u4ee5\u4fbf\u4e0b\u6b21\u8bbf\u95ee\u9875\u9762\u65f6\u80fd\u591f\u91cd\u65b0\u83b7\u53d6\u6700\u65b0\u7684\u6570\u636e\u3002<\/li>\n<li>\u4f8b\u5982&#xff0c;\u5f53\u7528\u6237\u9000\u51fa\u83dc\u8c31\u9875\u9762\u6216\u8005\u5728\u4e00\u5b9a\u6761\u4ef6\u4e0b&#xff08;\u5982\u540e\u53f0\u6570\u636e\u66f4\u65b0\u901a\u77e5&#xff09;&#xff0c;\u5e94\u8be5\u6e05\u9664recipeCache\u4e2d\u7684\u6570\u636e\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u751f\u547d\u5468\u671f\u94a9\u5b50\u7684\u9009\u62e9&#xff1a;<\/p>\n<ul>\n<li>destroyed \u751f\u547d\u5468\u671f\u94a9\u5b50&#xff1a;\u5728\u7ec4\u4ef6\u6b63\u5e38\u9500\u6bc1\u65f6&#xff0c;destroyed\u94a9\u5b50\u4f1a\u88ab\u89e6\u53d1\u3002\u5982\u679c\u7ec4\u4ef6\u6ca1\u6709\u88abKeep &#8211; alive\u5305\u88f9&#xff0c;\u8fd9\u4e2a\u94a9\u5b50\u53ef\u4ee5\u7528\u6765\u6e05\u9664\u7f13\u5b58\u3002\u4f8b\u5982&#xff1a;\n<p>javascript<\/p>\n<p> destroyed() {<br \/>\n  this.$store.commit(&#039;clearRecipeCache&#039;);<br \/>\n}\n <\/li>\n<li>deactivated \u751f\u547d\u5468\u671f\u94a9\u5b50&#xff1a;\u5f53\u7ec4\u4ef6\u88abKeep &#8211; alive\u5305\u88f9\u65f6&#xff0c;\u7ec4\u4ef6\u5728\u5207\u6362\u65f6\u4e0d\u4f1a\u88ab\u9500\u6bc1&#xff0c;\u800c\u662f\u4f1a\u89e6\u53d1deactivated\u94a9\u5b50\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b&#xff0c;\u5e94\u8be5\u5728deactivated\u94a9\u5b50\u4e2d\u6e05\u9664\u7f13\u5b58&#xff0c;\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u53ca\u65f6\u66f4\u65b0\u3002\u4f8b\u5982&#xff1a;\n<p>javascript<\/p>\n<p> deactivated() {<br \/>\n  this.$store.commit(&#039;clearRecipeCache&#039;);<br \/>\n}<\/p>\n<p> \u8fd9\u91cc\u7684clearRecipeCache\u662f\u4e00\u4e2amutation&#xff0c;\u7528\u4e8e\u6e05\u9664recipeCache\u4e2d\u7684\u6570\u636e&#xff0c;\u6bd4\u5982\u5c06recipeCache\u5bf9\u8c61\u91cd\u7f6e\u4e3a\u7a7a\u5bf9\u8c61\u7b49\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u3010\u4ee3\u7801\u301130\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406\u3002_vuex\u7f13\u5b58<\/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":[87,3092],"topic":[],"class_list":["post-36056","post","type-post","status-publish","format-standard","hentry","category-server","tag-87","tag-3092"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406 - \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\/36056.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u3010\u4ee3\u7801\u301130\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406\u3002_vuex\u7f13\u5b58\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/36056.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-07T07:51:58+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\/36056.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/36056.html\",\"name\":\"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-07T07:51:58+00:00\",\"dateModified\":\"2025-05-07T07:51:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/36056.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/36056.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36056.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406\"}]},{\"@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":"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406 - \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\/36056.html","og_locale":"zh_CN","og_type":"article","og_title":"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u3010\u4ee3\u7801\u301130\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406\u3002_vuex\u7f13\u5b58","og_url":"https:\/\/www.wsisp.com\/helps\/36056.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-07T07:51:58+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\/36056.html","url":"https:\/\/www.wsisp.com\/helps\/36056.html","name":"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-07T07:51:58+00:00","dateModified":"2025-05-07T07:51:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/36056.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/36056.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/36056.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"30\u3001Vuex \u4e3a\u5565\u53ef\u4ee5\u8fdb\u884c\u7f13\u5b58\u5904\u7406"}]},{"@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\/36056","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=36056"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36056\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=36056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=36056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=36056"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=36056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}