Skip to content

Commit 12e7b60

Browse files
committed
add router.start to vue-router migration guide
1 parent ec8f1bd commit 12e7b60

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/guide/migration-vue-router.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,45 @@ order: 26
88
99
<p class="tip">The list of deprecations below should be relatively complete, but the migration helper is still being updated to catch them.</p>
1010

11+
## Router Initialization
12+
13+
### `router.start` <sup>deprecated</sup>
14+
15+
There is no longer a special API to initialize an app with Vue Router. That means instead of:
16+
17+
``` js
18+
router.start({
19+
template: '<router-view></router-view>'
20+
}, '#app')
21+
```
22+
23+
You'll just pass a router property to a Vue instance:
24+
25+
``` js
26+
new Vue({
27+
el: '#app',
28+
router: router,
29+
template: '<router-view></router-view>'
30+
})
31+
```
32+
33+
Or, if you're using the runtime-only build of Vue:
34+
35+
``` js
36+
new Vue({
37+
el: '#app',
38+
router: router,
39+
render: h => h('router-view')
40+
})
41+
```
42+
43+
{% raw %}
44+
<div class="upgrade-path">
45+
<h4>Upgrade Path</h4>
46+
<p>Run the <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> on your codebase to find examples of <code>router.start</code> being called.</p>
47+
</div>
48+
{% endraw %}
49+
1150
## Route Definitions
1251

1352
### `router.map` <sup>deprecated</sup>

0 commit comments

Comments
 (0)