]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: fix dead links
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 27 Feb 2023 13:25:32 +0000 (14:25 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 27 Feb 2023 13:25:32 +0000 (14:25 +0100)
packages/docs/guide/advanced/dynamic-routing.md
packages/docs/guide/essentials/history-mode.md
packages/docs/guide/migration/index.md
packages/docs/zh/guide/essentials/history-mode.md
packages/docs/zh/guide/migration/index.md

index b75129569f6672a536ed9e43564aee0beb2dd1ff..86fd3aacbb3d7afc91bc63517160187081a4b469 100644 (file)
@@ -59,23 +59,29 @@ Because we are redirecting, we are replacing the ongoing navigation, effectively
 There are few different ways to remove existing routes:
 
 - By adding a route with a conflicting name. If you add a route that has the same name as an existing route, it will remove the route first and then add the route:
+
   ```js
   router.addRoute({ path: '/about', name: 'about', component: About })
   // this will remove the previously added route because they have the same name and names are unique
   router.addRoute({ path: '/other', name: 'about', component: Other })
   ```
+
 - By calling the callback returned by `router.addRoute()`:
+
   ```js
   const removeRoute = router.addRoute(routeRecord)
   removeRoute() // removes the route if it exists
   ```
+
   This is useful when the routes do not have a name
 - By using `router.removeRoute()` to remove a route by its name:
+
   ```js
   router.addRoute({ path: '/about', name: 'about', component: About })
   // remove the route
   router.removeRoute('about')
   ```
+
   Note you can use `Symbol`s for names in routes if you wish to use this function but want to avoid conflicts in names.
 
 Whenever a route is removed, **all of its aliases and children** are removed with it.
@@ -104,5 +110,5 @@ router.addRoute({
 
 Vue Router gives you two functions to look at existing routes:
 
-- [`router.hasRoute()`](../../api/interfaces/router.html#Methods-hasRoute): check if a route exists
-- [`router.getRoutes()`](../../api/interfaces/Router.html#Methods-getRoutes): get an array with all the route records.
+- [`router.hasRoute()`](/api/interfaces/Router.md#Methods-hasRoute): check if a route exists
+- [`router.getRoutes()`](/api/interfaces/Router.md#Methods-getRoutes): get an array with all the route records.
index 231dcaec53522490cb8ea8f67191c2d5cd1a515e..b46d67ccb55561d43239d7d6ac7c2bb7fd172a2f 100644 (file)
@@ -68,7 +68,7 @@ While it's not recommended, you can use this mode inside Browser applications bu
 
 ### Apache
 
-```apacheconf
+```
 <IfModule mod_negotiation.c>
   Options -MultiViews
 </IfModule>
index ffe7b6b1ba608b1c2aa9b755aca3baa7c19a827e..7e226e33384b39460a733c7970822a2be0ca2386 100644 (file)
@@ -207,7 +207,7 @@ At the moment navigation guards in mixins are not supported. You can track its s
 
 ### Removal of `router.match` and changes to `router.resolve`
 
-Both `router.match`, and `router.resolve` have been merged together into `router.resolve` with a slightly different signature. [Refer to the API](api/interfaces/router#Methods-resolve) for more details.
+Both `router.match`, and `router.resolve` have been merged together into `router.resolve` with a slightly different signature. [Refer to the API](/api/interfaces/Router.md#Methods-resolve) for more details.
 
 **Reason**: Uniting multiple methods that were used for the same purpose.
 
@@ -421,10 +421,10 @@ Note this will work if `path` was `/parent/` as the relative location `home` to
 
 Decoded values in `params`, `query`, and `hash` are now consistent no matter where the navigation is initiated (older browsers will still produce unencoded `path` and `fullPath`). The initial navigation should yield the same results as in-app navigations.
 
-Given any [normalized route location](../../api/#routelocationnormalized):
+Given any [normalized route location](/api/interfaces/RouteLocationNormalized.md):
 
 - Values in `path`, `fullPath` are not decoded anymore. They will appear as provided by the browser (most browsers provide them encoded). e.g. directly writing on the address bar `https://example.com/hello world` will yield the encoded version: `https://example.com/hello%20world` and both `path` and `fullPath` will be `/hello%20world`.
-- `hash` is now decoded, that way it can be copied over: `router.push({ hash: $route.hash })` and be used directly in [scrollBehavior](../../api/#scrollbehavior)'s `el` option.
+- `hash` is now decoded, that way it can be copied over: `router.push({ hash: $route.hash })` and be used directly in [scrollBehavior](/api/interfaces/RouterOptions.md#Properties-scrollBehavior)'s `el` option.
 - When using `push`, `resolve`, and `replace` and providing a `string` location or a `path` property in an object, **it must be encoded** (like in the previous version). On the other hand, `params`, `query` and `hash` must be provided in its unencoded version.
 - The slash character (`/`) is now properly decoded inside `params` while still producing an encoded version on the URL: `%2F`.
 
index 5a6e2ebd83de05814fe864a8e78a379ddbc60af9..24272629e4047777b5734c50a65fdb218410b877 100644 (file)
@@ -51,7 +51,7 @@ const router = createRouter({
 
 ### Apache
 
-```apacheconf
+```
 <IfModule mod_negotiation.c>
   Options -MultiViews
 </IfModule>
index 7681052f577485b7436c2a7c52866c442d04b6ba..c3cb6eb438fc2908ec380d6df9239434113cc7ec 100644 (file)
@@ -207,7 +207,7 @@ app.config.globalProperties.append = (path, pathToAppend) =>
 
 ### 删除 `router.match` 改为 `router.resolve`
 
-`router.match` 和 `router.resolve` 已合并到 `router.resolve` 中,签名略有不同。[详见 API](../../api/interfaces/router#Methods-resolve)。
+`router.match` 和 `router.resolve` 已合并到 `router.resolve` 中,签名略有不同。[详见 API](/api/interfaces/Router#Methods-resolve)。
 
 **原因**:将用于同一目的的多种方法统一起来。
 
@@ -412,10 +412,12 @@ const routes = [
 
 无论在哪里启动导航,`params`、`query`和 `hash` 中的解码值现在都是一致的(旧的浏览器仍然会产生未编码的 `path` 和 `fullPath`)。初始导航应产生与应用内部导航相同的结果。
 
-给定任何[规范化的路由地址](../../api/#routelocationnormalized):
+<!-- TODO: translate chinese API entries -->
 
-- `path`, `fullPath`中的值不再被解码了。例如,直接在地址栏上写 "https://example.com/hello world",将得到编码后的版本:"https://example.com/hello%20world",而 "path "和 "fullPath "都是"/hello%20world"。
-- `hash` 现在被解码了,这样就可以复制过来。`router.push({ hash: $route.hash })` 可以直接用于 [scrollBehavior](../../api/#scrollbehavior) 的 `el` 配置中。
+给定任何[规范化的路由地址](/api/interfaces/RouteLocationNormalized.md):
+
+- `path`, `fullPath`中的值不再被解码了。例如,直接在地址栏上写 "<https://example.com/hello> world",将得到编码后的版本:"https://example.com/hello%20world",而 "path "和 "fullPath "都是"/hello%20world"。
+- `hash` 现在被解码了,这样就可以复制过来。`router.push({ hash: $route.hash })` 可以直接用于 [scrollBehavior](/api/interfaces/RouterOptions.md#Properties-scrollBehavior) 的 `el` 配置中。
 - 当使用 `push`、`resolve` 和 `replace` 并在对象中提供 `string` 地址或 `path` 属性时,**必须进行编码**(像以前的版本一样)。另一方面,`params`、`query` 和 `hash` 必须以未编码的版本提供。
 - 斜线字符(`/`)现在已在 `params` 内正确解码,同时仍在 URL 上产生一个编码版本:`%2F`。