Skip to content

Commit 902fbd9

Browse files
committed
docs: pin links to path-to-regexp
1 parent 63d288c commit 902fbd9

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

Diff for: docs/fr/guide/essentials/dynamic-matching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const User = {
6767

6868
## Motifs de concordance avancés
6969

70-
`vue-router` utilise [path-to-regexp](https://github.com/pillarjs/path-to-regexp) comme moteur de concordance de chemin, il supporte donc plusieurs motifs de concordance avancés tels que la présence optionnelle de segments dynamiques, aucun ou plusieurs motifs, plus d'options par motifs, et même des motifs d'expressions régulières personnalisés. Consultez cette [documentation](https://github.com/pillarjs/path-to-regexp#parameters) pour utiliser ces motifs avancés et [cet exemple](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) pour les utiliser avec `vue-router`.
70+
`vue-router` utilise [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0) comme moteur de concordance de chemin, il supporte donc plusieurs motifs de concordance avancés tels que la présence optionnelle de segments dynamiques, aucun ou plusieurs motifs, plus d'options par motifs, et même des motifs d'expressions régulières personnalisés. Consultez cette [documentation](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters) pour utiliser ces motifs avancés et [cet exemple](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) pour les utiliser avec `vue-router`.
7171

7272
## Priorité de concordance
7373

Diff for: docs/guide/essentials/dynamic-matching.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Very often we will need to map routes with the given pattern to the same component. For example we may have a `User` component which should be rendered for all users but with different user IDs. In `vue-router` we can use a dynamic segment in the path to achieve that:
44

5-
``` js
5+
```js
66
const User = {
77
template: '<div>User</div>'
88
}
@@ -19,7 +19,7 @@ Now URLs like `/user/foo` and `/user/bar` will both map to the same route.
1919

2020
A dynamic segment is denoted by a colon `:`. When a route is matched, the value of the dynamic segments will be exposed as `this.$route.params` in every component. Therefore, we can render the current user ID by updating `User`'s template to this:
2121

22-
``` js
22+
```js
2323
const User = {
2424
template: '<div>User {{ $route.params.id }}</div>'
2525
}
@@ -29,9 +29,9 @@ You can check out a live example [here](https://jsfiddle.net/yyx990803/4xfa2f19/
2929

3030
You can have multiple dynamic segments in the same route, and they will map to corresponding fields on `$route.params`. Examples:
3131

32-
| pattern | matched path | $route.params |
33-
|---------|------|--------|
34-
| /user/:username | /user/evan | `{ username: 'evan' }` |
32+
| pattern | matched path | \$route.params |
33+
| ----------------------------- | ------------------- | -------------------------------------- |
34+
| /user/:username | /user/evan | `{ username: 'evan' }` |
3535
| /user/:username/post/:post_id | /user/evan/post/123 | `{ username: 'evan', post_id: '123' }` |
3636

3737
In addition to `$route.params`, the `$route` object also exposes other useful information such as `$route.query` (if there is a query in the URL), `$route.hash`, etc. You can check out the full details in the [API Reference](../../api/#the-route-object).
@@ -42,11 +42,11 @@ One thing to note when using routes with params is that when the user navigates
4242

4343
To react to params changes in the same component, you can simply watch the `$route` object:
4444

45-
``` js
45+
```js
4646
const User = {
4747
template: '...',
4848
watch: {
49-
'$route' (to, from) {
49+
$route(to, from) {
5050
// react to route changes...
5151
}
5252
}
@@ -55,7 +55,7 @@ const User = {
5555

5656
Or, use the `beforeRouteUpdate` [navigation guard](../advanced/navigation-guards.html) introduced in 2.2:
5757

58-
``` js
58+
```js
5959
const User = {
6060
template: '...',
6161
beforeRouteUpdate (to, from, next) {
@@ -97,7 +97,7 @@ this.$route.params.pathMatch // '/non-existing'
9797

9898
## Advanced Matching Patterns
9999

100-
`vue-router` uses [path-to-regexp](https://github.com/pillarjs/path-to-regexp) as its path matching engine, so it supports many advanced matching patterns such as optional dynamic segments, zero or more / one or more requirements, and even custom regex patterns. Check out its [documentation](https://github.com/pillarjs/path-to-regexp#parameters) for these advanced patterns, and [this example](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) of using them in `vue-router`.
100+
`vue-router` uses [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0) as its path matching engine, so it supports many advanced matching patterns such as optional dynamic segments, zero or more / one or more requirements, and even custom regex patterns. Check out its [documentation](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters) for these advanced patterns, and [this example](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) of using them in `vue-router`.
101101

102102
## Matching Priority
103103

Diff for: docs/ja/guide/essentials/dynamic-matching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ this.$route.params.pathMatch // '/non-existing'
9696

9797
## 高度なマッチングパターン
9898

99-
`vue-router` はパスのマッチングエンジンとして [path-to-regexp](https://github.com/pillarjs/path-to-regexp) を使っています。これは Optional による動的なセグメント、Zero or more / One or more に対する要求、また、カスタム正規表現パターンまでもサポートしています。 これらの高度なパターンについてはこちらの [ドキュメンテーション](https://github.com/pillarjs/path-to-regexp#parameters) または、 `vue-router` の中でそれらを使っている [こちらの例](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) をご参照ください。
99+
`vue-router` はパスのマッチングエンジンとして [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0) を使っています。これは Optional による動的なセグメント、Zero or more / One or more に対する要求、また、カスタム正規表現パターンまでもサポートしています。 これらの高度なパターンについてはこちらの [ドキュメンテーション](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters) または、 `vue-router` の中でそれらを使っている [こちらの例](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) をご参照ください。
100100

101101
## マッチングの優先度
102102

Diff for: docs/kr/guide/essentials/dynamic-matching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const User = {
6868

6969
### 고급 매칭 패턴
7070

71-
`vue-router`는 라우트 매칭 엔진으로 [path-to-regexp](https://github.com/pillarjs/path-to-regexp)를 사용하기 때문에 선택적 동적 세그먼트, 0개 이상/하나 이상의 요구 사항, 심지어 커스텀 정규식 패턴과 같은 많은 고급 매칭 패턴을 지원합니다. 이 고급 패턴들과 `vue-router`에서 사용하는 [예제](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js)에 대한 [문서](https://github.com/pillarjs/path-to-regexp#parameters)를 확인하십시오.
71+
`vue-router`는 라우트 매칭 엔진으로 [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0)를 사용하기 때문에 선택적 동적 세그먼트, 0개 이상/하나 이상의 요구 사항, 심지어 커스텀 정규식 패턴과 같은 많은 고급 매칭 패턴을 지원합니다. 이 고급 패턴들과 `vue-router`에서 사용하는 [예제](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js)에 대한 [문서](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters)를 확인하십시오.
7272

7373
### 매칭 우선순위
7474

Diff for: docs/ru/guide/essentials/dynamic-matching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ this.$route.params.pathMatch // '/non-existing'
9797

9898
## Продвинутые возможности сопоставления
9999

100-
`vue-router` использует [path-to-regexp](https://github.com/pillarjs/path-to-regexp) в качестве движка для проверки совпадения маршрутов, что позволяет задействовать многие продвинутые возможности, включая опциональные динамические сегменты и регулярные выражения. Подробнее об этих продвинутых возможностях можно изучить в [документации библиотеки](https://github.com/pillarjs/path-to-regexp#parameters), а на [примере](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) узнать как использовать их совместно с `vue-router`.
100+
`vue-router` использует [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0) в качестве движка для проверки совпадения маршрутов, что позволяет задействовать многие продвинутые возможности, включая опциональные динамические сегменты и регулярные выражения. Подробнее об этих продвинутых возможностях можно изучить в [документации библиотеки](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters), а на [примере](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) узнать как использовать их совместно с `vue-router`.
101101

102102
## Приоритеты при сопоставлении маршрутов
103103

Diff for: docs/zh/guide/essentials/dynamic-matching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ this.$route.params.pathMatch // '/non-existing'
9696

9797
## 高级匹配模式
9898

99-
`vue-router` 使用 [path-to-regexp](https://github.com/pillarjs/path-to-regexp) 作为路径匹配引擎,所以支持很多高级的匹配模式,例如:可选的动态路径参数、匹配零个或多个、一个或多个,甚至是自定义正则匹配。查看它的 [文档](https://github.com/pillarjs/path-to-regexp#parameters) 学习高阶的路径匹配,还有 [这个例子 ](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) 展示 `vue-router` 怎么使用这类匹配。
99+
`vue-router` 使用 [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0) 作为路径匹配引擎,所以支持很多高级的匹配模式,例如:可选的动态路径参数、匹配零个或多个、一个或多个,甚至是自定义正则匹配。查看它的 [文档](https://github.com/pillarjs/path-to-regexp/tree/v1.7.0#parameters) 学习高阶的路径匹配,还有 [这个例子 ](https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js) 展示 `vue-router` 怎么使用这类匹配。
100100

101101
## 匹配优先级
102102

0 commit comments

Comments
 (0)