{"id":58854,"date":"2025-08-16T17:10:18","date_gmt":"2025-08-16T09:10:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/58854.html"},"modified":"2025-08-16T17:10:18","modified_gmt":"2025-08-16T09:10:18","slug":"vue-%e7%89%88%e6%9c%ac3props%e5%a3%b0%e6%98%8e%e5%92%8c%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/58854.html","title":{"rendered":"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528"},"content":{"rendered":"<p>\u5728 Vue 3 \u4e2d&#xff0c;Props \u58f0\u660e\u6709\u4e24\u79cd\u4e3b\u8981\u65b9\u5f0f&#xff1a;Options API\u00a0\u4e2d\u7684\u00a0<span style=\"color:#be191c\">props\u00a0<\/span>\u9009\u9879\u548c\u00a0Composition API\u00a0\u4e2d\u7684\u00a0<span style=\"color:#be191c\">defineProps<\/span>\u00a0\u5b8f\u3002\u4ee5\u4e0b\u662f\u5b83\u4eec\u7684\u8be6\u7ec6\u5bf9\u6bd4\u548c\u4f7f\u7528\u8bf4\u660e&#xff1a;<\/p>\n<h4 id=\"\u4e00\u3001\u6838\u5fc3\u533a\u522b\">\u4e00\u3001\u6838\u5fc3\u533a\u522b<\/h4>\n<table>\n<tr>\u7279\u6027props\u00a0(Options API)defineProps\u00a0(Composition API)<\/tr>\n<tbody>\n<tr>\n<td>\u4f7f\u7528\u573a\u666f<\/td>\n<td>Options API \u7ec4\u4ef6<\/td>\n<td>&lt;script setup&gt;\u00a0\u7ec4\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u4f4d\u7f6e<\/td>\n<td>\u7ec4\u4ef6\u9009\u9879\u5bf9\u8c61\u5185<\/td>\n<td>&lt;script setup&gt;\u00a0\u9876\u5c42\u4f5c\u7528\u57df<\/td>\n<\/tr>\n<tr>\n<td>\u8bbf\u95ee\u65b9\u5f0f<\/td>\n<td>\u901a\u8fc7\u00a0this\u00a0\u8bbf\u95ee<\/td>\n<td>\u901a\u8fc7\u8fd4\u56de\u503c\u8bbf\u95ee<\/td>\n<\/tr>\n<tr>\n<td>\u54cd\u5e94\u6027<\/td>\n<td>\u81ea\u52a8\u54cd\u5e94\u5f0f<\/td>\n<td>\u81ea\u52a8\u54cd\u5e94\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>TypeScript<\/td>\n<td>\u9700\u00a0PropType\u00a0\u8f85\u52a9<\/td>\n<td>\u539f\u751f\u652f\u6301\u7c7b\u578b\u63a8\u5bfc<\/td>\n<\/tr>\n<tr>\n<td>\u9ed8\u8ba4\u503c<\/td>\n<td>default\u00a0\u5c5e\u6027<\/td>\n<td>default\u00a0\u5c5e\u6027 \u6216\u00a0withDefaults<\/td>\n<\/tr>\n<tr>\n<td>\u7f16\u8bd1\u65f6<\/td>\n<td>\u8fd0\u884c\u65f6\u58f0\u660e<\/td>\n<td>\u7f16\u8bd1\u65f6\u5b8f&#xff08;\u7f16\u8bd1\u540e\u6d88\u5931&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h4 id=\"\u4e8c\u3001props-(options-api)-\u4f7f\u7528\u8be6\u89e3\">\u4e8c\u3001props\u00a0(Options API) \u4f7f\u7528\u8be6\u89e3<\/h4>\n<p>export default {<br \/>\n  props: {<br \/>\n    \/\/ \u7c7b\u578b\u58f0\u660e<br \/>\n    title: String,<\/p>\n<p>    \/\/ \u8be6\u7ec6\u914d\u7f6e<br \/>\n    count: {<br \/>\n      type: Number,<br \/>\n      required: true,<br \/>\n      validator: value &#061;&gt; value &gt;&#061; 0<br \/>\n    },<\/p>\n<p>    \/\/ \u5e26\u9ed8\u8ba4\u503c\u7684\u5bf9\u8c61<br \/>\n    config: {<br \/>\n      type: Object,<br \/>\n      default: () &#061;&gt; ({ size: &#039;medium&#039; })<br \/>\n    },<\/p>\n<p>    \/\/ TS \u7c7b\u578b\u652f\u6301<br \/>\n    book: {<br \/>\n      type: Object as PropType&lt;Book&gt;,<br \/>\n      default: null<br \/>\n    }<br \/>\n  },<br \/>\n  mounted() {<br \/>\n    console.log(this.title) \/\/ \u901a\u8fc7 this \u8bbf\u95ee<br \/>\n  }<br \/>\n}<\/p>\n<h4 id=\"\u4e09\u3001defineprops\u00a0(composition-api)-\u4f7f\u7528\u8be6\u89e3\">\u4e09\u3001defineProps\u00a0(Composition API) \u4f7f\u7528\u8be6\u89e3<\/h4>\n<h5 id=\"1.-\u57fa\u7840\u7528\u6cd5\">1. \u57fa\u7840\u7528\u6cd5<\/h5>\n<p>&lt;script setup&gt;<br \/>\n\/\/ \u8fd0\u884c\u65f6\u58f0\u660e (JS)<br \/>\nconst props &#061; defineProps({<br \/>\n  title: String,<br \/>\n  count: {<br \/>\n    type: Number,<br \/>\n    required: true<br \/>\n  },<br \/>\n  tags: {<br \/>\n    type: Array,<br \/>\n    default: () &#061;&gt; []<br \/>\n  }<br \/>\n})<\/p>\n<p>console.log(props.title) \/\/ \u76f4\u63a5\u8bbf\u95ee<br \/>\n&lt;\/script&gt;<\/p>\n<h5 id=\"2.-typescript-\u7c7b\u578b\u58f0\u660e&#xff08;\u63a8\u8350&#xff09;\">2. TypeScript \u7c7b\u578b\u58f0\u660e&#xff08;\u63a8\u8350&#xff09;<\/h5>\n<p>&lt;script setup lang&#061;&#034;ts&#034;&gt;<br \/>\n\/\/ \u7eaf\u7c7b\u578b\u58f0\u660e (TS)<br \/>\ninterface Props {<br \/>\n  id: number<br \/>\n  title: string<br \/>\n  disabled?: boolean<br \/>\n  sizes?: string[]<br \/>\n}<\/p>\n<p>const props &#061; defineProps&lt;Props&gt;()<br \/>\n&lt;\/script&gt;<\/p>\n<h5 id=\"3.-\u5e26\u9ed8\u8ba4\u503c\u7684-ts-\u58f0\u660e\">3. \u5e26\u9ed8\u8ba4\u503c\u7684 TS \u58f0\u660e<\/h5>\n<p>&lt;script setup lang&#061;&#034;ts&#034;&gt;<br \/>\nimport { withDefaults } from &#039;vue&#039;<\/p>\n<p>interface Props {<br \/>\n  size?: &#039;sm&#039; | &#039;md&#039; | &#039;lg&#039;<br \/>\n  labels?: string[]<br \/>\n}<\/p>\n<p>\/\/ \u63d0\u4f9b\u9ed8\u8ba4\u503c<br \/>\nconst props &#061; withDefaults(defineProps&lt;Props&gt;(), {<br \/>\n  size: &#039;md&#039;,<br \/>\n  labels: () &#061;&gt; [&#039;OK&#039;, &#039;Cancel&#039;]<br \/>\n})<br \/>\n&lt;\/script&gt;<\/p>\n<h4 id=\"\u56db\u3001\u5173\u952e\u5dee\u5f02\u8be6\u89e3\">\u56db\u3001\u5173\u952e\u5dee\u5f02\u8be6\u89e3<\/h4>\n<h5 id=\"1.-\u7c7b\u578b\u7cfb\u7edf\u652f\u6301\">1. \u7c7b\u578b\u7cfb\u7edf\u652f\u6301<\/h5>\n<p>\/\/ Options API (\u9700 PropType)<br \/>\nimport type { PropType } from &#039;vue&#039;<\/p>\n<p>props: {<br \/>\n  book: {<br \/>\n    type: Object as PropType&lt;Book&gt;, \/\/ \u9700\u8981\u7c7b\u578b\u65ad\u8a00<br \/>\n    required: true<br \/>\n  }<br \/>\n}<\/p>\n<p>\/\/ Composition API (\u76f4\u63a5\u7c7b\u578b)<br \/>\ndefineProps&lt;{ book: Book }&gt;()<\/p>\n<h5 id=\"2.-\u9ed8\u8ba4\u503c\u5904\u7406\">2. \u9ed8\u8ba4\u503c\u5904\u7406<\/h5>\n<p>\/\/ Options API<br \/>\nprops: {<br \/>\n  items: {<br \/>\n    type: Array,<br \/>\n    default: () &#061;&gt; [] \/\/ \u5fc5\u987b\u7528\u5de5\u5382\u51fd\u6570<br \/>\n  }<br \/>\n}<\/p>\n<p>\/\/ Composition API (\u7eafTS\u65f6)<br \/>\nwithDefaults(defineProps&lt;{ items?: string[] }&gt;(), {<br \/>\n  items: () &#061;&gt; [&#039;default&#039;] \/\/ \u5de5\u5382\u51fd\u6570<br \/>\n})<\/p>\n<h5 id=\"3.-\u8bbf\u95ee\u65b9\u5f0f\">3. \u8bbf\u95ee\u65b9\u5f0f<\/h5>\n<p>&lt;script&gt;<br \/>\n\/\/ Options API<br \/>\nexport default {<br \/>\n  props: [&#039;message&#039;],<br \/>\n  methods: {<br \/>\n    show() {<br \/>\n      console.log(this.message) \/\/ \u901a\u8fc7 this<br \/>\n    }<br \/>\n  }<br \/>\n}<br \/>\n&lt;\/script&gt;<\/p>\n<p>&lt;script setup&gt;<br \/>\n\/\/ Composition API<br \/>\nconst props &#061; defineProps([&#039;message&#039;])<br \/>\nconsole.log(props.message) \/\/ \u76f4\u63a5\u8bbf\u95ee<br \/>\n&lt;\/script&gt;<\/p>\n<h4 id=\"\u4e94\u3001\u6700\u4f73\u5b9e\u8df5\u6307\u5357\">\u4e94\u3001\u6700\u4f73\u5b9e\u8df5\u6307\u5357<\/h4>\n<li>\n<p>\u65b0\u9879\u76ee\u4f18\u5148\u9009\u62e9&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528\u00a0&lt;script setup&gt;\u00a0&#043;\u00a0defineProps\u00a0&#043; TypeScript<\/p>\n<\/li>\n<li>\n<p>\u83b7\u5f97\u66f4\u597d\u7684\u7c7b\u578b\u652f\u6301\u548c\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u9ed8\u8ba4\u503c\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5bf9\u8c61\/\u6570\u7ec4\u5fc5\u987b\u4f7f\u7528\u5de5\u5382\u51fd\u6570\u8fd4\u56de\u65b0\u5b9e\u4f8b<\/p>\n<\/li>\n<\/ul>\n<p>\/\/ \u2705 \u6b63\u786e<br \/>\ndefault: () &#061;&gt; [1, 2, 3]<\/p>\n<p>\/\/ \u274c \u9519\u8bef&#xff08;\u5171\u4eab\u5f15\u7528&#xff09;<br \/>\ndefault: [1, 2, 3]\n<\/li>\n<li>\n<p>\u590d\u6742\u9a8c\u8bc1&#xff1a;<\/p>\n<p>defineProps({<br \/>\n  email: {<br \/>\n    validator(value) {<br \/>\n      return \/^[^\\\\s&#064;]&#043;&#064;[^\\\\s&#064;]&#043;\\\\.[^\\\\s&#064;]&#043;$\/.test(value)<br \/>\n    }<br \/>\n  }<br \/>\n})\n<\/li>\n<li>\n<p>\u8de8API\u517c\u5bb9&#xff1a;<\/p>\n<ul>\n<li>\n<p>Options API \u58f0\u660e\u7684 props \u5728 Composition API \u7684\u00a0setup()\u00a0\u4e2d\u53ef\u901a\u8fc7\u53c2\u6570\u8bbf\u95ee<\/p>\n<\/li>\n<\/ul>\n<p>export default {<br \/>\n  props: [&#039;message&#039;],<br \/>\n  setup(props) {<br \/>\n    console.log(props.message)<br \/>\n  }<br \/>\n}\n<\/li>\n<h4 id=\"\u516d\u3001\u9ad8\u7ea7\u7528\u6cd5\u793a\u4f8b\">\u516d\u3001\u9ad8\u7ea7\u7528\u6cd5\u793a\u4f8b<\/h4>\n<h5 id=\"1.-\u8054\u5408\u7c7b\u578b-&#043;-\u9ed8\u8ba4\u503c\">1. \u8054\u5408\u7c7b\u578b &#043; \u9ed8\u8ba4\u503c<\/h5>\n<p>&lt;script setup lang&#061;&#034;ts&#034;&gt;<br \/>\ninterface Props {<br \/>\n  variant?: &#039;primary&#039; | &#039;secondary&#039; | &#039;text&#039;<br \/>\n}<\/p>\n<p>const { variant &#061; &#039;primary&#039; } &#061; defineProps&lt;Props&gt;()<br \/>\n&lt;\/script&gt;<\/p>\n<h5 id=\"2.-\u52a8\u6001-prop-\u540d\u79f0\">2. \u52a8\u6001 Prop \u540d\u79f0<\/h5>\n<p>&lt;script setup&gt;<br \/>\nconst dynamicKey &#061; &#039;dynamicProp&#039;<\/p>\n<p>defineProps({<br \/>\n  [dynamicKey]: {<br \/>\n    type: String,<br \/>\n    default: &#039;&#039;<br \/>\n  }<br \/>\n})<br \/>\n&lt;\/script&gt;<\/p>\n<h5 id=\"3.-\u54cd\u5e94\u5f0f\u89e3\u6784&#xff08;\u4fdd\u7559\u54cd\u5e94\u6027&#xff09;\">3. \u54cd\u5e94\u5f0f\u89e3\u6784&#xff08;\u4fdd\u7559\u54cd\u5e94\u6027&#xff09;<\/h5>\n<p>&lt;script setup&gt;<br \/>\nimport { toRefs } from &#039;vue&#039;<\/p>\n<p>const props &#061; defineProps({ count: Number })<br \/>\nconst { count } &#061; toRefs(props) \/\/ \u4fdd\u6301\u54cd\u5e94\u6027<br \/>\n&lt;\/script&gt;<\/p>\n<h4 id=\"\u4e03\u3001\u6838\u5fc3\u603b\u7ed3\">\u4e03\u3001\u6838\u5fc3\u603b\u7ed3<\/h4>\n<table>\n<tr>\u7279\u6027props\u00a0(Options)defineProps\u00a0(Composition)<\/tr>\n<tbody>\n<tr>\n<td>\u58f0\u660e\u4f4d\u7f6e<\/td>\n<td>\u7ec4\u4ef6\u9009\u9879\u5185<\/td>\n<td>&lt;script setup&gt;\u00a0\u9876\u5c42<\/td>\n<\/tr>\n<tr>\n<td>\u7c7b\u578b\u652f\u6301<\/td>\n<td>\u9700\u00a0PropType\u00a0\u8f85\u52a9<\/td>\n<td>\u539f\u751f TS \u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u9ed8\u8ba4\u503c<\/td>\n<td>default\u00a0\u5c5e\u6027<\/td>\n<td>withDefaults\u00a0\u6216\u00a0default<\/td>\n<\/tr>\n<tr>\n<td>\u8bbf\u95ee\u65b9\u5f0f<\/td>\n<td>this.propName<\/td>\n<td>props.propName<\/td>\n<\/tr>\n<tr>\n<td>\u54cd\u5e94\u6027<\/td>\n<td>\u81ea\u52a8\u54cd\u5e94\u5f0f<\/td>\n<td>\u81ea\u52a8\u54cd\u5e94\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>\u7f16\u8bd1\u5904\u7406<\/td>\n<td>\u8fd0\u884c\u65f6\u6821\u9a8c<\/td>\n<td>\u7f16\u8bd1\u65f6\u5b8f&#xff08;\u65e0\u8fd0\u884c\u65f6\u5f00\u9500&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u63a8\u8350\u573a\u666f<\/td>\n<td>\u4f20\u7edf Options API \u7ec4\u4ef6<\/td>\n<td>\u73b0\u4ee3 Composition API \u7ec4\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fc1\u79fb\u5efa\u8bae&#xff1a;\u65b0\u9879\u76ee\u5e94\u4f18\u5148\u4f7f\u7528\u00a0&lt;script setup&gt;\u00a0&#043;\u00a0defineProps&#xff0c;\u8001\u9879\u76ee\u9010\u6b65\u8fc1\u79fb\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u7c7b\u578b\u652f\u6301\u548c\u5f00\u53d1\u4f53\u9a8c\u3002\u4e24\u8005\u5728\u529f\u80fd\u4e0a\u662f\u7b49\u6548\u7684&#xff0c;\u4f46 Composition API \u65b9\u5f0f\u66f4\u7b26\u5408\u73b0\u4ee3 Vue \u5f00\u53d1\u6a21\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb106\u6b21\u3002vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528<\/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":[187,625,6210],"topic":[],"class_list":["post-58854","post","type-post","status-publish","format-standard","hentry","category-server","tag-javascript","tag-vue-js","tag-vue"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528 - \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\/58854.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb106\u6b21\u3002vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/58854.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-16T09:10:18+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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58854.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/58854.html\",\"name\":\"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-16T09:10:18+00:00\",\"dateModified\":\"2025-08-16T09:10:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/58854.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/58854.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/58854.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528\"}]},{\"@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":"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528 - \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\/58854.html","og_locale":"zh_CN","og_type":"article","og_title":"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb106\u6b21\u3002vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528","og_url":"https:\/\/www.wsisp.com\/helps\/58854.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-16T09:10:18+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/58854.html","url":"https:\/\/www.wsisp.com\/helps\/58854.html","name":"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-16T09:10:18+00:00","dateModified":"2025-08-16T09:10:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/58854.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/58854.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/58854.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"vue \u7248\u672c3Props\u58f0\u660e\u548c\u4f7f\u7528"}]},{"@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\/58854","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=58854"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/58854\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=58854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=58854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=58854"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=58854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}