{"id":8663,"date":"2021-11-28T16:35:05","date_gmt":"2021-11-28T08:35:05","guid":{"rendered":"https:\/\/sdeno.com\/?p=8663"},"modified":"2023-02-01T16:24:38","modified_gmt":"2023-02-01T08:24:38","slug":"vue3-no-match-found-for-location-with-path","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=8663","title":{"rendered":"vue3 No match found for location with path \"\/\""},"content":{"rendered":"<p>\u4ed4\u7ec6\u68c0\u67e5\u4f60\u7684\u8def\u7531\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u8fd9\u91cc\u662fname\u5b57\u6bb5\u91cd\u540d\uff0c\u4e5f\u6709\u53ef\u80fd\u662f\u54ea\u91cc\u5355\u8bcd\u5199\u9519\u4e5f\u53ef\u80fd\u9020\u6210<\/p>\n<pre>const routes = [\r\n  {\r\n    path: '\/',\r\n    name: '<span style=\"color: #ff0000;\">Home<\/span>',\r\n    component: Home\r\n  },\r\n  {\r\n    path: '\/about',\r\n    name: 'About',\r\n    \/\/ route level code-splitting\r\n    \/\/ this generates a separate chunk (about.[hash].js) for this route\r\n    \/\/ which is lazy-loaded when the route is visited.\r\n    component: () =&gt; import(\/* webpackChunkName: \"about\" *\/ '..\/views\/About.vue')\r\n  },\r\n  {\r\n    path: '\/login',\r\n    name: '<span style=\"color: #ff0000;\">Home<\/span>', \/\/\u6539\u6210\u522b\u7684\u540d\u5b57\u5c31\u53ef\u4ee5\r\n    component: Login\r\n  },\r\n]<\/pre>\n<p>&nbsp;<\/p>\n<p>\u6216\u8005<\/p>\n<p>&nbsp;<\/p>\n<p>\u6dfb\u52a0\u4e00\u4e2a\u9759\u6001\u8def\u7531\uff0c\u5339\u914d\u4efb\u610f\u8def\u5f84\u6307\u5411404\u9519\u8bef\u9875\u9762\u3002\u8fd9\u6837\u80fd\u4fdd\u8bc1\u63a7\u5236\u4e0d\u4f1a\u62a5\u9519[Vue Router warn]: No match found for location with path &#8220;\/***\/index&#8221;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">[\r\n  ...\r\n  {\r\n     \/\/ hide: true,\r\n     path: '\/:pathMatch(.*)*',\r\n     component: () =&gt; import('@\/views\/error-page\/404'),\r\n  }\r\n]\r\n\u6d4b\u8bd5\u8def\u7531\u7248\u672cvue-router\": \"^4.1.6\"<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ed4\u7ec6\u68c0\u67e5\u4f60\u7684\u8def\u7531\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u8fd9\u91cc\u662fname\u5b57\u6bb5\u91cd\u540d\uff0c\u4e5f\u6709\u53ef\u80fd\u662f\u54ea\u91cc\u5355\u8bcd\u5199\u9519\u4e5f\u53ef\u80fd\u9020\u6210 const routes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-8663","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/8663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8663"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/8663\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}