You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/essentials/history-mode.md
+6-4
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ When using history mode, the URL will look "normal," e.g. `http://oursite.com/us
15
15
16
16
Here comes a problem, though: Since our app is a single page client side app, without a proper server configuration, the users will get a 404 error if they access `http://oursite.com/user/id` directly in their browser. Now that's ugly.
17
17
18
-
Not to worry: To fix the issue, all you need to do is add a simple catch-all fallback route to your server. If the URL doesn't match any static assets, it should serve the same `index.html` page that your app lives in. Beautiful, again!
18
+
Not to worry: To fix the issue, all you need to do is add a simple catch-all fallback route to your server. If the URL doesn't match any static assets, it should serve the same `index.html` page that your app lives in. Beautiful, again!
19
19
20
20
## Example Server Configurations
21
21
@@ -45,6 +45,7 @@ location / {
45
45
For Node.js/Express, consider using [connect-history-api-fallback middleware](https://github.com/bripkens/connect-history-api-fallback).
46
46
47
47
#### Internet Information Services (IIS)
48
+
48
49
```xml
49
50
<?xml version="1.0" encoding="UTF-8"?>
50
51
<configuration>
@@ -61,10 +62,10 @@ For Node.js/Express, consider using [connect-history-api-fallback middleware](ht
Copy file name to clipboardExpand all lines: docs/en/essentials/passing-props.md
+4-7
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,10 @@ const User = {
27
27
constrouter=newVueRouter({
28
28
routes: [
29
29
{ path:'/user/:id', component: User, props:true }
30
-
30
+
31
31
// for routes with named views, you have to define the props option for each named view:
32
32
{
33
-
path:'/user/:id',
33
+
path:'/user/:id',
34
34
components: { default: User, sidebar: Sidebar },
35
35
props: { default:true, sidebar:false }
36
36
}
@@ -59,8 +59,7 @@ const router = new VueRouter({
59
59
60
60
### Function mode
61
61
62
-
You can create a function that returns props.
63
-
This allows you to cast the parameter to another type, combine static values with route-based values, etc.
62
+
You can create a function that returns props. This allows you to cast the parameter to another type, combine static values with route-based values, etc.
64
63
65
64
```js
66
65
constrouter=newVueRouter({
@@ -72,8 +71,6 @@ const router = new VueRouter({
72
71
73
72
The url: `/search?q=vue` would pass `{query: "vue"}` as props to the SearchUser component.
74
73
75
-
Try to keep the props function stateless, as it's only evaluated on route changes.
76
-
Use a wrapper component if you need state to define the props, that way vue can react to state changes.
77
-
74
+
Try to keep the props function stateless, as it's only evaluated on route changes. Use a wrapper component if you need state to define the props, that way vue can react to state changes.
78
75
79
76
For advanced usage, checkout the [example](https://github.com/vuejs/vue-router/blob/dev/examples/route-props/app.js).
[Unpkg.com](https://unpkg.com) fournit des liens CDN basés sur NPM. Le lien ci-dessus pointera toujours vers la dernière release sur NPM. Vous pouvez aussi utiliser un tag ou une version spécifique via une URL comme `https://unpkg.com/[email protected]/dist/vue-router.js`.
8
+
[Unpkg.com](https://unpkg.com) fournit des liens CDN basés sur npm. Le lien ci-dessus pointera toujours vers la dernière version sur npm. Vous pouvez aussi utiliser un tag ou une version spécifique via une URL comme `https://unpkg.com/[email protected]/dist/vue-router.js`.
9
9
<!--/email_off-->
10
10
11
11
Incluez `vue-router` après Vue et l'installation sera automatique :
@@ -15,7 +15,7 @@ Incluez `vue-router` après Vue et l'installation sera automatique :
0 commit comments