{"id":102292,"date":"2026-09-08T11:13:57","date_gmt":"2026-09-08T03:13:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/102292.html"},"modified":"2026-09-08T11:13:57","modified_gmt":"2026-09-08T03:13:57","slug":"const-proxy-getcurrentinstance-%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/102292.html","title":{"rendered":"const { proxy } = getCurrentInstance() \u8be6\u89e3"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908031356-6a9f7d7468236.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>\u4e00\u3001\u8fd9\u884c\u4ee3\u7801\u7684\u542b\u4e49<\/h4>\n<p><span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> proxy <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">getCurrentInstance<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u62c6\u89e3\u6765\u770b&#xff1a;<\/p>\n<table>\n<tr>\u90e8\u5206\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>getCurrentInstance()<\/td>\n<td>Vue 3 \u7ec4\u5408\u5f0f API&#xff0c;\u83b7\u53d6\u5f53\u524d\u7ec4\u4ef6\u5b9e\u4f8b&#xff08;\u4ec5\u5728 setup \u4e2d\u6709\u6548&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>{ proxy }<\/td>\n<td>\u89e3\u6784\u51fa\u5b9e\u4f8b\u7684 proxy \u5c5e\u6027<\/td>\n<\/tr>\n<tr>\n<td>proxy<\/td>\n<td>\u7ec4\u4ef6\u5b9e\u4f8b\u7684\u4ee3\u7406\u5bf9\u8c61&#xff0c;\u7b49\u540c\u4e8e Options API \u4e2d\u7684 this<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7b80\u5355\u8bf4&#xff1a;proxy \u5c31\u662f Vue 2 \u4e2d\u4f60\u719f\u6089\u7684 this\u3002<\/p>\n<hr \/>\n<h4>\u4e8c\u3001\u4e3a\u4ec0\u4e48\u9700\u8981\u5b83&#xff1f;<\/h4>\n<p>\u5728 Vue 3 \u7684 &lt;script setup&gt; \u4e2d&#xff0c;\u6ca1\u6709 this&#xff0c;\u6240\u4ee5\u65e0\u6cd5\u76f4\u63a5\u8bbf\u95ee&#xff1a;<\/p>\n<table>\n<tr>\u60f3\u8bbf\u95ee\u7684\u4e1c\u897fVue 2 \u5199\u6cd5Vue 3 &lt;script setup&gt; \u5199\u6cd5<\/tr>\n<tbody>\n<tr>\n<td>\u5168\u5c40\u5c5e\u6027<\/td>\n<td>this.$refs<\/td>\n<td>proxy.$refs<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u5c40\u65b9\u6cd5<\/td>\n<td>this.useDict<\/td>\n<td>proxy.useDict<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u63d2\u4ef6<\/td>\n<td>this.$modal<\/td>\n<td>proxy.$modal<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>getCurrentInstance() \u5c31\u662f\u5f25\u8865\u8fd9\u4e2a\u7f3a\u53e3\u7684\u6865\u6881\u3002<\/p>\n<hr \/>\n<h4>\u4e09\u3001\u5728\u672c\u6587\u4ef6\u4e2d\u7684\u5173\u8054\u94fe<\/h4>\n<p>getCurrentInstance()<br \/>\n       \u2502<br \/>\n       \u25bc<br \/>\n  proxy&#xff08;\u7ec4\u4ef6\u4ee3\u7406\u5bf9\u8c61&#xff0c;\u7b49\u540c\u4e8e this&#xff09;<br \/>\n       \u2502<br \/>\n       \u25bc<br \/>\n  proxy.$refs.loginRef  \u2190 \u8bbf\u95ee\u6a21\u677f\u4e2d ref&#061;&#034;loginRef&#034; \u7684\u8868\u5355\u7ec4\u4ef6<br \/>\n       \u2502<br \/>\n       \u25bc<br \/>\n  .validate(valid &#061;&gt; {&#8230;})  \u2190 \u8c03\u7528 Element Plus \u8868\u5355\u7684\u9a8c\u8bc1\u65b9\u6cd5<br \/>\n       \u2502<br \/>\n       \u25bc<br \/>\n  \u9a8c\u8bc1\u901a\u8fc7 \u2192 \u6267\u884c\u767b\u5f55\u903b\u8f91<\/p>\n<p>\u5177\u4f53\u5bf9\u5e94\u5173\u7cfb&#xff1a;<\/p>\n<p>\u6a21\u677f\u4e2d&#xff08;\u7b2c3\u884c&#xff09;&#xff1a;<\/p>\n<p><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>el-form<\/span> <span class=\"token attr-name\">ref<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>loginRef<span class=\"token punctuation\">&#034;<\/span><\/span> <span class=\"token attr-name\">:model<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>loginForm<span class=\"token punctuation\">&#034;<\/span><\/span> <span class=\"token attr-name\">:rules<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">&#061;<\/span><span class=\"token punctuation\">&#034;<\/span>loginRules<span class=\"token punctuation\">&#034;<\/span><\/span> <span class=\"token attr-name\">&#8230;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>&#x1f446; \u901a\u8fc7 ref&#061;&#034;loginRef&#034; \u7ed9\u8868\u5355\u7ec4\u4ef6\u6ce8\u518c\u5f15\u7528<\/p>\n<p>\u811a\u672c\u4e2d&#xff08;\u7b2c97\u884c&#xff09;&#xff1a;<\/p>\n<p>proxy<span class=\"token punctuation\">.<\/span>$refs<span class=\"token punctuation\">.<\/span>loginRef<span class=\"token punctuation\">.<\/span><span class=\"token function\">validate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">valid<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>valid<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u9a8c\u8bc1\u901a\u8fc7&#xff0c;\u6267\u884c\u767b\u5f55<\/span><br \/>\n    loading<span class=\"token punctuation\">.<\/span>value <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">true<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>&#x1f446; \u901a\u8fc7 proxy.$refs.loginRef \u62ff\u5230\u8868\u5355\u5b9e\u4f8b&#xff0c;\u8c03\u7528 validate() \u65b9\u6cd5<\/p>\n<hr \/>\n<h4>\u56db\u3001\u5b8c\u6574\u5173\u8054\u56fe<\/h4>\n<p>\u250c\u2500 \u6a21\u677f \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  &lt;el-form ref&#061;&#034;loginRef&#034; &#8230;&gt;                    \u2502<br \/>\n\u2502    &lt;el-input v-model&#061;&#034;loginForm.username&#034;&gt;       \u2502<br \/>\n\u2502    &lt;el-input v-model&#061;&#034;loginForm.password&#034;&gt;       \u2502<br \/>\n\u2502    &lt;el-input v-model&#061;&#034;loginForm.code&#034;&gt;           \u2502<br \/>\n\u2502    &lt;el-button &#064;click&#061;&#034;handleLogin&#034;&gt;              \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\n           \u2502 \u70b9\u51fb\u6309\u94ae<br \/>\n           \u25bc<br \/>\n\u250c\u2500 handleLogin() \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502  proxy.$refs.loginRef.validate(valid &#061;&gt; {       \u2502<br \/>\n\u2502    if (valid) {                                  \u2502<br \/>\n\u2502      \u2460 \u8bb0\u4f4f\u5bc6\u7801 \u2192 Cookies.set(&#8230;)              \u2502<br \/>\n\u2502      \u2461 userStore.login(loginForm.value)  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2192 store\/modules\/user.js<br \/>\n\u2502         .then(() &#061;&gt; {                            \u2502<br \/>\n\u2502           router.push(redirect || &#034;\/&#034;)  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2192 \u8df3\u8f6c\u9996\u9875<br \/>\n\u2502         })                                       \u2502<br \/>\n\u2502         .catch(() &#061;&gt; {                           \u2502<br \/>\n\u2502           getCode()  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2192 \u91cd\u65b0\u83b7\u53d6\u9a8c\u8bc1\u7801<br \/>\n\u2502         })                                       \u2502<br \/>\n\u2502    }                                             \u2502<br \/>\n\u2502  })                                              \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<hr \/>\n<h4>\u4e94\u3001\u26a0\ufe0f \u503c\u5f97\u6ce8\u610f\u7684\u95ee\u9898<\/h4>\n<p>getCurrentInstance() \u662f Vue \u7684\u5185\u90e8 API&#xff0c;\u5b98\u65b9\u6587\u6863\u660e\u786e\u6807\u6ce8&#xff1a;<\/p>\n<p>\u26a0\ufe0f getCurrentInstance \u4ec5\u5728 setup \u6216\u751f\u547d\u5468\u671f\u94a9\u5b50\u4e2d\u53ef\u7528\u3002\u4e0d\u8981\u5728\u5f02\u6b65\u64cd\u4f5c\u540e\u8c03\u7528\u5b83\u3002<\/p>\n<p>\u800c\u4e14 Vue \u5b98\u65b9\u4e0d\u63a8\u8350\u5728\u751f\u4ea7\u4ee3\u7801\u4e2d\u76f4\u63a5\u4f7f\u7528\u5b83\u6765\u8bbf\u95ee proxy&#xff0c;\u66f4\u63a8\u8350\u7684\u505a\u6cd5\u662f&#xff1a;<\/p>\n<table>\n<tr>\u5f53\u524d\u5199\u6cd5\u63a8\u8350\u5199\u6cd5<\/tr>\n<tbody>\n<tr>\n<td>proxy.$refs.loginRef.validate(&#8230;)<\/td>\n<td>loginRef.value.validate(&#8230;)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u63a8\u8350\u6539\u6cd5&#xff1a;\u76f4\u63a5\u7528 ref \u6a21\u677f\u5f15\u7528&#xff0c;\u65e0\u9700 getCurrentInstance&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ \u58f0\u660e\u6a21\u677f\u5f15\u7528<\/span><br \/>\n<span class=\"token keyword\">const<\/span> loginRef <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">ref<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">null<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u76f4\u63a5\u4f7f\u7528&#xff0c;\u65e0\u9700 proxy<\/span><br \/>\n<span class=\"token keyword\">function<\/span> <span class=\"token function\">handleLogin<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  loginRef<span class=\"token punctuation\">.<\/span>value<span class=\"token punctuation\">.<\/span><span class=\"token function\">validate<\/span><span class=\"token punctuation\">(<\/span><span class=\"token parameter\">valid<\/span> <span class=\"token operator\">&#061;&gt;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>valid<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u6a21\u677f\u4e2d ref&#061;&#034;loginRef&#034; \u4f1a\u81ea\u52a8\u7ed1\u5b9a\u5230\u540c\u540d\u7684 const loginRef &#061; ref(null)&#xff0c;\u8fd9\u662f Vue 3 &lt;script setup&gt; \u7684\u5b98\u65b9\u63a8\u8350\u65b9\u5f0f&#xff0c;\u66f4\u7b80\u6d01\u3001\u7c7b\u578b\u5b89\u5168\u3001\u65e0\u5185\u90e8 API \u4f9d\u8d56\u3002<\/p>\n<hr \/>\n<h4>\u516d\u3001proxy \u7684\u5176\u4ed6\u7528\u9014<\/h4>\n<p>\u5728\u672c\u9879\u76ee\u4e2d&#xff0c;proxy \u8fd8\u5e38\u7528\u4e8e\u8bbf\u95ee [main.js](file:\/\/\/e:\/fuqiu-front-back\/2-fuqiu-back-end\/back-v1.0.0\/src\/main.js) \u4e2d\u6302\u8f7d\u7684\u5168\u5c40\u65b9\u6cd5&#xff1a;<\/p>\n<p><span class=\"token comment\">\/\/ main.js \u4e2d\u6302\u8f7d\u7684\u5168\u5c40\u65b9\u6cd5<\/span><br \/>\napp<span class=\"token punctuation\">.<\/span>config<span class=\"token punctuation\">.<\/span>globalProperties<span class=\"token punctuation\">.<\/span>useDict <span class=\"token operator\">&#061;<\/span> useDict<br \/>\napp<span class=\"token punctuation\">.<\/span>config<span class=\"token punctuation\">.<\/span>globalProperties<span class=\"token punctuation\">.<\/span>download <span class=\"token operator\">&#061;<\/span> download<br \/>\napp<span class=\"token punctuation\">.<\/span>config<span class=\"token punctuation\">.<\/span>globalProperties<span class=\"token punctuation\">.<\/span>parseTime <span class=\"token operator\">&#061;<\/span> parseTime<br \/>\n<span class=\"token comment\">\/\/ &#8230;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5176\u4ed6\u7ec4\u4ef6\u4e2d\u901a\u8fc7 proxy \u8bbf\u95ee<\/span><br \/>\nproxy<span class=\"token punctuation\">.<\/span><span class=\"token function\">useDict<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;sys_normal_disable&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\nproxy<span class=\"token punctuation\">.<\/span><span class=\"token function\">download<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#039;system\/user\/export&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token operator\">&#8230;<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\nproxy<span class=\"token punctuation\">.<\/span><span class=\"token function\">parseTime<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Date<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8fd9\u4e9b\u5168\u5c40\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u901a\u8fc7 import \u76f4\u63a5\u5f15\u5165\u5bf9\u5e94\u5de5\u5177\u51fd\u6570\u6765\u66ff\u4ee3&#xff0c;\u907f\u514d\u4f9d\u8d56 proxy\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u8fd9\u884c\u4ee3\u7801\u7684\u542b\u4e49<br \/>\nconst { proxy }  getCurrentInstance()\u62c6\u89e3\u6765\u770b&#xff1a;\u90e8\u5206\u542b\u4e49getCurrentInstance()Vue 3 \u7ec4\u5408\u5f0f API&#xff0c;\u83b7\u53d6\u5f53\u524d\u7ec4\u4ef6\u5b9e\u4f8b&#xff08;\u4ec5\u5728 setup \u4e2d\u6709\u6548&#xff09;{ proxy }\u89e3\u6784\u51fa\u5b9e\u4f8b\u7684 proxy \u5c5e\u6027proxy\u7ec4\u4ef6\u5b9e\u4f8b\u7684\u4ee3\u7406\u5bf9\u8c61&#xff0c;\u7b49\u540c\u4e8e Options API \u4e2d\u7684 this\u7b80\u5355\u8bf4&#xff1a;proxy \u5c31\u662f Vue 2 \u4e2d\u4f60\u719f\u6089\u7684<\/p>\n","protected":false},"author":2,"featured_media":102291,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[722,187,190],"topic":[],"class_list":["post-102292","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-ecmascript","tag-javascript","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>const { proxy } = getCurrentInstance() \u8be6\u89e3 - \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\/102292.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"const { proxy } = getCurrentInstance() \u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u8fd9\u884c\u4ee3\u7801\u7684\u542b\u4e49 const { proxy } getCurrentInstance()\u62c6\u89e3\u6765\u770b&#xff1a;\u90e8\u5206\u542b\u4e49getCurrentInstance()Vue 3 \u7ec4\u5408\u5f0f API&#xff0c;\u83b7\u53d6\u5f53\u524d\u7ec4\u4ef6\u5b9e\u4f8b&#xff08;\u4ec5\u5728 setup \u4e2d\u6709\u6548&#xff09;{ proxy }\u89e3\u6784\u51fa\u5b9e\u4f8b\u7684 proxy \u5c5e\u6027proxy\u7ec4\u4ef6\u5b9e\u4f8b\u7684\u4ee3\u7406\u5bf9\u8c61&#xff0c;\u7b49\u540c\u4e8e Options API \u4e2d\u7684 this\u7b80\u5355\u8bf4&#xff1a;proxy \u5c31\u662f Vue 2 \u4e2d\u4f60\u719f\u6089\u7684\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/102292.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-08T03:13:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908031356-6a9f7d7468236.png\" \/>\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\/102292.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/102292.html\",\"name\":\"const { proxy } = getCurrentInstance() \u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-08T03:13:57+00:00\",\"dateModified\":\"2026-09-08T03:13:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/102292.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/102292.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102292.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"const { proxy } = getCurrentInstance() \u8be6\u89e3\"}]},{\"@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":"const { proxy } = getCurrentInstance() \u8be6\u89e3 - \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\/102292.html","og_locale":"zh_CN","og_type":"article","og_title":"const { proxy } = getCurrentInstance() \u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u8fd9\u884c\u4ee3\u7801\u7684\u542b\u4e49 const { proxy } getCurrentInstance()\u62c6\u89e3\u6765\u770b&#xff1a;\u90e8\u5206\u542b\u4e49getCurrentInstance()Vue 3 \u7ec4\u5408\u5f0f API&#xff0c;\u83b7\u53d6\u5f53\u524d\u7ec4\u4ef6\u5b9e\u4f8b&#xff08;\u4ec5\u5728 setup \u4e2d\u6709\u6548&#xff09;{ proxy }\u89e3\u6784\u51fa\u5b9e\u4f8b\u7684 proxy \u5c5e\u6027proxy\u7ec4\u4ef6\u5b9e\u4f8b\u7684\u4ee3\u7406\u5bf9\u8c61&#xff0c;\u7b49\u540c\u4e8e Options API \u4e2d\u7684 this\u7b80\u5355\u8bf4&#xff1a;proxy \u5c31\u662f Vue 2 \u4e2d\u4f60\u719f\u6089\u7684","og_url":"https:\/\/www.wsisp.com\/helps\/102292.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-08T03:13:57+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908031356-6a9f7d7468236.png"}],"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\/102292.html","url":"https:\/\/www.wsisp.com\/helps\/102292.html","name":"const { proxy } = getCurrentInstance() \u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-08T03:13:57+00:00","dateModified":"2026-09-08T03:13:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/102292.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/102292.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/102292.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"const { proxy } = getCurrentInstance() \u8be6\u89e3"}]},{"@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\/102292","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=102292"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102292\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/102291"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=102292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=102292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=102292"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=102292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}