{"id":930,"date":"2024-01-17T09:51:28","date_gmt":"2024-01-17T01:51:28","guid":{"rendered":"http:\/\/ericw.top\/?p=930"},"modified":"2024-01-17T11:08:08","modified_gmt":"2024-01-17T03:08:08","slug":"%e8%b7%af%e7%94%b1%e8%bf%9b%e9%98%b6","status":"publish","type":"post","link":"http:\/\/ericw.top\/?p=930","title":{"rendered":"\u8def\u7531\u8fdb\u9636"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"toc-0\">\u8def\u7531\u7684\u5c01\u88c5\u62bd\u79bb<\/h2>\n\n\n\n<p>\u5c06\u8def\u7531\u7684\u914d\u7f6e\u63d0\u51fa\u6765\uff0c<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><strong>\u521b\u5efa\u65b0\u7684\u914d\u7f6e\u6a21\u5757<\/strong><\/mark>\uff0c<code class=\"prettyprint\" >index.js<\/code> \u4e2d<br>\u7136\u540e\u5728\u4e3b\u914d\u7f6e\u6a21\u5757\u4e2d<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">\u5f15\u5165\u8def\u7531\u914d\u7f6e\u6a21\u5757<\/mark><\/strong>\u5373\u53ef<\/p>\n\n\n\n<p>\u5c06\u8def\u7531\u6a21\u5757\u62bd\u79bb\u51fa\u6765    \u597d\u5904\uff1a<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u62c6\u5206\u6a21\u5757\uff0c\u5229\u4e8e\u7ef4\u62a4<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"327\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-71-e1705456453685-1024x327.png\" alt=\"\" class=\"wp-image-931\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-71-e1705456453685-1024x327.png 1024w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-71-e1705456453685-300x96.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-71-e1705456453685-768x245.png 768w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-71-e1705456453685-1536x491.png 1536w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-71-e1705456453685.png 1577w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-1\">\u58f0\u660e\u5f0f\u5bfc\u822a<\/h2>\n\n\n\n<p><code class=\"prettyprint\" >vue-router<\/code> \u63d0\u4f9b\u4e86\u4e00\u4e2a\u5168\u5c40\u7ec4\u4ef6 <code class=\"prettyprint\" >&lt;strong&gt;router-link&lt;\/strong&gt;<\/code> (\u53d6\u4ee3 a \u6807\u7b7e)<\/p>\n\n\n\n<p>1\u3001\u80fd<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">\u8df3\u8f6c<\/mark><\/strong>\uff0c\u914d\u7f6e to \u5c5e\u6027\u6307\u5b9a\u8def\u5f84(\u5fc5\u987b) \u3002\u672c\u8d28\u8fd8\u662f a \u6807\u7b7e \uff0c<code class=\"prettyprint\" >to \u65e0\u9700 #<\/code><\/p>\n\n\n\n<p>2\u3001\u80fd<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-cyan-blue-color\">\u9ad8\u4eae<\/mark><\/strong>\uff0c\u9ed8\u8ba4\u5c31\u4f1a\u63d0\u4f9b\u9ad8\u4eae\u7c7b\u540d\uff0c\u53ef\u4ee5<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>\u76f4\u63a5\u8bbe\u7f6e\u9ad8\u4eae\u6837\u5f0f<\/strong><\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"314\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-72-1024x314.png\" alt=\"\" class=\"wp-image-932\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-72-1024x314.png 1024w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-72-300x92.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-72-768x235.png 768w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-72-1536x471.png 1536w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-72.png 1557w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-2\">\u58f0\u660e\u5f0f\u5bfc\u822a  \u4e24\u4e2a\u7c7b\u540d<\/h2>\n\n\n\n<p>\u6211\u4eec\u53d1\u73b0 <code class=\"prettyprint\" >router-link<\/code> \u81ea\u52a8\u7ed9\u5f53\u524d\u5bfc\u822a\u6dfb\u52a0\u4e86 <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">\u4e24\u4e2a\u9ad8\u4eae\u7c7b\u540d<\/mark><\/strong><\/p>\n\n\n\n<p>1\u3001<code class=\"prettyprint\" >router-link-active<\/code> \u6a21\u7cca\u5339\u914d (\u7528\u7684\u591a)<\/p>\n\n\n\n<p><code class=\"prettyprint\" >to=&quot;\/my&quot;<\/code> \u53ef\u4ee5\u5339\u914d <code class=\"prettyprint\" >\/my \/my\/a \/my\/b ....<\/code><\/p>\n\n\n\n<p>2\u3001<code class=\"prettyprint\" >router-link-exact-active<\/code> \u7cbe\u786e\u5339\u914d<\/p>\n\n\n\n<p><code class=\"prettyprint\" >to=&quot;\/my&quot;<\/code> \u4ec5\u53ef\u4ee5\u5339\u914d <code class=\"prettyprint\" >\/my<\/code><\/p>\n\n\n\n<p>____________________________________________________________<\/p>\n\n\n\n<p><strong>\u6211\u4eec\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4e24\u4e2a\u7c7b\u540d<\/strong>\uff1a<\/p>\n\n\n\n<p>\u5728\u8def\u7531\u6a21\u5757\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >const router = new VueRouter({\n  routes: &#091;...],\n  linkActiveClass: &quot;\u7c7b\u540d1&quot;,\n  linkExactActiveClass: &quot;\u7c7b\u540d2&quot;\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"503\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-73-1024x503.png\" alt=\"\" class=\"wp-image-933\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-73-1024x503.png 1024w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-73-300x147.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-73-768x377.png 768w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-73-1536x755.png 1536w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-73.png 1585w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-3\">\u58f0\u660e\u5f0f\u5bfc\u822a  \u8df3\u8f6c\u4f20\u53c2<\/h2>\n\n\n\n<p>\u5728\u8df3\u8f6c\u8def\u7531\u65f6, \u53ef\u4ee5\u8fdb\u884c\u4f20\u503c<\/p>\n\n\n\n<p>1. \u67e5\u8be2\u53c2\u6570\u4f20\u53c2<br>  \u2460 \u8bed\u6cd5\u683c\u5f0f:<br>      <code class=\"prettyprint\" >to=&quot;\/path?\u53c2\u6570\u540d=\u503c&quot;<\/code><br>  \u2461 \u5bf9\u5e94\u9875\u9762\u7ec4\u4ef6\u63a5\u6536\u4f20\u9012\u8fc7\u6765\u7684\u503c:<br>      <code class=\"prettyprint\" >$route.query.\u53c2\u6570\u540d<\/code><\/p>\n\n\n\n<p>2. \u52a8\u6001\u8def\u7531\u4f20\u53c2<br>  \u2460 \u914d\u7f6e\u52a8\u6001\u8def\u7531<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >const router = new VueRouter({\n  routes: &#091;\n    ...,\n    {\n      path: &#039;\/search\/:words&#039;,\n      component: Search\n    }\n  ]\n})<\/code><\/pre>\n\n\n\n<p>  \u2461 \u914d\u7f6e\u5bfc\u822a\u94fe\u63a5<br>      <code class=\"prettyprint\" >to=&quot;\/path\/\u53c2\u6570\u503c&quot;<\/code><br>  \u2462 \u5bf9\u5e94\u9875\u9762\u7ec4\u4ef6\u63a5\u6536\u4f20\u9012\u8fc7\u6765\u7684\u503c<br>      <code class=\"prettyprint\" >$route.params.\u53c2\u6570\u540d<\/code><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4e24\u79cd\u4f20\u53c2\u65b9\u5f0f\u7684\u533a\u522b:<\/p>\n\n\n\n<p>1. \u67e5\u8be2\u53c2\u6570\u4f20\u53c2 (\u6bd4\u8f83\u9002\u5408\u4f20<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u591a\u4e2a\u53c2\u6570<\/mark>)<br>\u2460 \u8df3\u8f6c\uff1a<code class=\"prettyprint\" >to=&quot;\/path?\u53c2\u6570\u540d=\u503c&amp;\u53c2\u6570\u540d2=\u503c&quot;<\/code><br>\u2461 \u83b7\u53d6\uff1a<code class=\"prettyprint\" >$route.query.\u53c2\u6570\u540d<\/code><\/p>\n\n\n\n<p>2. \u52a8\u6001\u8def\u7531\u4f20\u53c2 (\u4f18\u96c5\u7b80\u6d01\uff0c<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">\u4f20\u5355\u4e2a\u53c2\u6570<\/mark>\u6bd4\u8f83\u65b9\u4fbf)<br>\u2460 \u914d\u7f6e\u52a8\u6001\u8def\u7531\uff1a<code class=\"prettyprint\" >path: &quot;\/path\/\u53c2\u6570\u540d&quot;<\/code><br>\u2461 \u8df3\u8f6c\uff1a<code class=\"prettyprint\" >to=&quot;\/path\/\u53c2\u6570\u503c&quot;<\/code><br>\u2462 \u83b7\u53d6\uff1a<code class=\"prettyprint\" >$route.params.\u53c2\u6570\u540d<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-4\">\u52a8\u6001\u8def\u7531\u53c2\u6570\u53ef\u9009\u7b26<\/h2>\n\n\n\n<p><strong>\u95ee\u9898\uff1a<\/strong>\u914d\u4e86\u8def\u7531 <code class=\"prettyprint\" >path: &quot;\/search\/:words&quot;<\/code> \u4e3a\u4ec0\u4e48\u6309\u4e0b\u9762\u6b65\u9aa4\u64cd\u4f5c\uff0c\u4f1a\u672a\u5339\u914d\u5230\u7ec4\u4ef6\uff0c\u663e\u793a\u7a7a\u767d\uff1f<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"616\" height=\"344\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-74.png\" alt=\"\" class=\"wp-image-937\" style=\"width:284px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-74.png 616w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-74-300x168.png 300w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/figure>\n\n\n\n<p><strong>\u539f\u56e0\uff1a <\/strong><code class=\"prettyprint\" >\/search\/:words<\/code> \u8868\u793a\uff0c\u5fc5\u987b\u8981\u4f20\u53c2\u6570\u3002\u5982\u679c\u4e0d\u4f20\u53c2\u6570\uff0c\u4e5f\u5e0c\u671b\u5339\u914d\uff0c\u53ef\u4ee5\u52a0\u4e2a\u53ef\u9009\u7b26 \"<code class=\"prettyprint\" >?<\/code>\"<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >const router = new VueRouter({\n  routes: &#091;\n    { path: &#039;\/&#039;, redirect: &#039;\/home&#039; },\n    { path: &#039;\/home&#039;, component: Home },\n    { path: &#039;\/search\/:words?&#039;, component: Search }\n  ]\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"756\" height=\"31\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-75.png\" alt=\"\" class=\"wp-image-938\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-75.png 756w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-75-300x12.png 300w\" sizes=\"(max-width: 756px) 100vw, 756px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-5\">Vue\u8def\u7531 - \u91cd\u5b9a\u5411<\/h2>\n\n\n\n<p><strong>\u95ee\u9898\uff1a<\/strong>\u7f51\u9875\u6253\u5f00\uff0c <code class=\"prettyprint\" >url<\/code> \u9ed8\u8ba4\u662f <code class=\"prettyprint\" >\/<\/code> \u8def\u5f84\uff0c\u672a\u5339\u914d\u5230\u7ec4\u4ef6\u65f6\uff0c\u4f1a\u51fa\u73b0\u7a7a\u767d<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"62\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-77-1024x62.png\" alt=\"\" class=\"wp-image-941\" style=\"width:591px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-77-1024x62.png 1024w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-77-300x18.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-77-768x47.png 768w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-77.png 1098w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong>\u91cd\u5b9a\u5411 \u2192 <strong>\u5339\u914dpath\u540e<\/strong>, \u5f3a\u5236<strong>\u8df3\u8f6cpath\u8def\u5f84<\/strong>    <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">\u66f4\u6539\u9ed8\u8ba4\u9996\u9875<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >const router = new VueRouter({\n  routes: &#091;\n    { path: &#039;\/&#039;, redirect: &#039;\/home&#039;},\n    { path: &#039;\/home&#039;, component: Home },\n    { path: &#039;\/search\/:words&#039;, component: Search }\n  ]\n})<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-6\">Vue\u8def\u7531 - 404<\/h2>\n\n\n\n<p><strong>\u4f5c\u7528\uff1a<\/strong>\u5f53\u8def\u5f84\u627e\u4e0d\u5230\u5339\u914d\u65f6\uff0c\u7ed9\u4e2a\u63d0\u793a\u9875\u9762<\/p>\n\n\n\n<p><strong>\u4f4d\u7f6e\uff1a<\/strong>\u914d\u5728\u8def\u7531\u6700\u540e<\/p>\n\n\n\n<p><strong>\u8bed\u6cd5\uff1a<\/strong><code class=\"prettyprint\" >path: &quot;*&quot;<\/code> (\u4efb\u610f\u8def\u5f84) \u2013 \u524d\u9762\u4e0d\u5339\u914d\u5c31\u547d\u4e2d\u6700\u540e\u8fd9\u4e2a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >import NotFind from &#039;@\/views\/NotFind&#039;\n\nconst router = new VueRouter({\n  routes: &#091;\n    { path: &#039;\/&#039;, redirect: &#039;\/home&#039; },\n    { path: &#039;\/home&#039;, component: Home },\n    { path: &#039;\/search\/:words?&#039;, component: Search },\n    { path: &#039;*&#039;, component: NotFind }\n  ]\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"656\" height=\"227\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-78.png\" alt=\"\" class=\"wp-image-942\" style=\"width:266px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-78.png 656w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-78-300x104.png 300w\" sizes=\"(max-width: 656px) 100vw, 656px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-7\">Vue\u8def\u7531 - \u6a21\u5f0f\u8bbe\u7f6e<\/h2>\n\n\n\n<p><strong>hash\u8def\u7531(\u9ed8\u8ba4)<\/strong> \u4f8b\u5982: <code class=\"prettyprint\" >http:\/\/localhost:8080\/#\/home<\/code><\/p>\n\n\n\n<p><strong>history\u8def\u7531(\u5e38\u7528)<\/strong> \u4f8b\u5982: <code class=\"prettyprint\" >http:\/\/localhost:8080\/home<\/code> (\u4ee5\u540e\u4e0a\u7ebf\u9700\u8981\u670d\u52a1\u5668\u7aef\u652f\u6301)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >const router = new VueRouter({\n  routes: &#091;]\n  mode: &quot;history&quot;\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"696\" height=\"310\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-79.png\" alt=\"\" class=\"wp-image-944\" style=\"width:407px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-79.png 696w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-79-300x134.png 300w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-8\">\u7f16\u7a0b\u5f0f\u5bfc\u822a - \u57fa\u672c\u8df3\u8f6c<\/h2>\n\n\n\n<p>\u7f16\u7a0b\u5f0f\u5bfc\u822a\uff1a<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u7528JS\u4ee3\u7801\u6765\u8fdb\u884c\u8df3\u8f6c<\/mark><\/strong><\/p>\n\n\n\n<p>\u4e24\u79cd\u8bed\u6cd5:<\/p>\n\n\n\n<p>\u2460 <code class=\"prettyprint\" >path<\/code> <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u8def\u5f84\u8df3\u8f6c<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >this.$router.push(&#039;\u8def\u7531\u8def\u5f84&#039;)\nthis.$router.push({\n  path: &#039;\u8def\u7531\u8def\u5f84&#039;\n})<\/code><\/pre>\n\n\n\n<p>\u2461 <code class=\"prettyprint\" >name<\/code> <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u547d\u540d\u8def\u7531\u8df3\u8f6c<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >this.$router.push({\nname: &#039;\u8def\u7531\u540d&#039;\n})<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >{ name: &#039;\u8def\u7531\u540d&#039;, path: &#039;\/path\/xxx&#039;, component: XXX },<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"toc-9\">\u7f16\u7a0b\u5f0f\u5bfc\u822a - \u8def\u7531\u4f20\u53c2<\/h2>\n\n\n\n<p>\u4e24\u79cd\u4f20\u53c2\u65b9\u5f0f\uff1a<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u67e5\u8be2\u53c2\u6570 + \u52a8\u6001\u8def\u7531\u4f20\u53c2<\/mark><\/strong><\/p>\n\n\n\n<p>\u4e24\u79cd\u8df3\u8f6c\u65b9\u5f0f\uff0c\u5bf9\u4e8e<strong>\u4e24\u79cd\u4f20\u53c2\u65b9\u5f0f\u90fd\u652f\u6301<\/strong>\uff1a<\/p>\n\n\n\n<p><strong>\u2460 path \u8def\u5f84\u8df3\u8f6c\u4f20\u53c2<\/strong><\/p>\n\n\n\n<p>    1\u3001<code class=\"prettyprint\" >path<\/code>\u8def\u5f84\u4f20\u53c2 <code class=\"prettyprint\" >query<\/code>\u4f20\u53c2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >this.$router.push(&#039;\/\u8def\u5f84?\u53c2\u6570\u540d1=\u53c2\u6570\u503c1&amp;\u53c2\u65702=\u53c2\u6570\u503c2&#039;)\nthis.$router.push({\n  path: &#039;\/\u8def\u5f84&#039;,\n  query: {\n    \u53c2\u6570\u540d1: &#039;\u53c2\u6570\u503c1&#039;,\n    \u53c2\u6570\u540d2: &#039;\u53c2\u6570\u503c2&#039;\n  }\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"775\" height=\"399\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-80.png\" alt=\"\" class=\"wp-image-949\" style=\"width:381px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-80.png 775w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-80-300x154.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-80-768x395.png 768w\" sizes=\"(max-width: 775px) 100vw, 775px\" \/><\/figure>\n\n\n\n<p>2\u3001<code class=\"prettyprint\" >path<\/code>\u8def\u5f84\u4f20\u53c2 <strong>\u52a8\u6001\u8def\u7531<\/strong>\u4f20\u53c2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >this.$router.push(&#039;\/\u8def\u5f84\/\u53c2\u6570\u503c&#039;)\nthis.$router.push({\n  path: &#039;\/\u8def\u5f84\/\u53c2\u6570\u503c&#039;\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"796\" height=\"477\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-81.png\" alt=\"\" class=\"wp-image-950\" style=\"width:394px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-81.png 796w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-81-300x180.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-81-768x460.png 768w\" sizes=\"(max-width: 796px) 100vw, 796px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\u2461 name \u547d\u540d\u8def\u7531\u8df3\u8f6c\u4f20\u53c2<\/strong><\/p>\n\n\n\n<p>    1\u3001name \u547d\u540d\u8def\u7531\u8df3\u8f6c\u4f20\u53c2 <code class=\"prettyprint\" >query<\/code>\u4f20\u53c2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >this.$router.push({\n  name: &#039;\u8def\u7531\u540d\u5b57&#039;,\n  query: {\n    \u53c2\u6570\u540d1: &#039;\u53c2\u6570\u503c1&#039;,\n    \u53c2\u6570\u540d2: &#039;\u53c2\u6570\u503c2&#039;\n  }\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"773\" height=\"371\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-82.png\" alt=\"\" class=\"wp-image-953\" style=\"width:396px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-82.png 773w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-82-300x144.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-82-768x369.png 768w\" sizes=\"(max-width: 773px) 100vw, 773px\" \/><\/figure>\n\n\n\n<p>2\u3001name \u547d\u540d\u8def\u7531\u8df3\u8f6c\u4f20\u53c2 <strong>\u52a8\u6001\u8def\u7531<\/strong>\u4f20\u53c2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >this.$router.push({\n  name: &#039;\u8def\u7531\u540d\u5b57&#039;,\n  params: {\n    \u53c2\u6570\u540d: &#039;\u53c2\u6570\u503c&#039;,\n  }\n})<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"851\" height=\"374\" src=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-83.png\" alt=\"\" class=\"wp-image-954\" style=\"width:398px;height:auto\" srcset=\"http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-83.png 851w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-83-300x132.png 300w, http:\/\/ericw.top\/wp-content\/uploads\/2024\/01\/image-83-768x338.png 768w\" sizes=\"(max-width: 851px) 100vw, 851px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u8def\u7531\u7684\u5c01\u88c5\u62bd\u79bb \u5c06\u8def\u7531\u7684\u914d\u7f6e\u63d0\u51fa\u6765\uff0c\u521b\u5efa\u65b0\u7684\u914d\u7f6e\u6a21\u5757\uff0cindex.js \u4e2d\u7136\u540e\u5728\u4e3b\u914d\u7f6e\u6a21\u5757\u4e2d\u5f15\u5165\u8def\u7531\u914d\u7f6e\u6a21\u5757\u5373 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":937,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,5],"tags":[],"_links":{"self":[{"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/posts\/930"}],"collection":[{"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ericw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=930"}],"version-history":[{"count":14,"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/posts\/930\/revisions"}],"predecessor-version":[{"id":959,"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/posts\/930\/revisions\/959"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/ericw.top\/index.php?rest_route=\/wp\/v2\/media\/937"}],"wp:attachment":[{"href":"http:\/\/ericw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ericw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=930"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ericw.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}