Skip to content

Commit 192dd90

Browse files
authored
Guide > Scaling Up > Routing の翻訳を追従 (#305)
* updated routing.md vuejs/docs@da71235#diff-c45fc2647705fe83e278fa345f8655c0f0b0e3729a998e8a698842aab60cc046 * Swap more examples to destructuring for accessing the global Vue vuejs/docs@e5b34b2#diff-c45fc2647705fe83e278fa345f8655c0f0b0e3729a998e8a698842aab60cc046 * Link vue-router-next in routing page vuejs/docs@b4b3eaf#diff-c45fc2647705fe83e278fa345f8655c0f0b0e3729a998e8a698842aab60cc046
1 parent da1fce5 commit 192dd90

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/guide/routing.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
## 公式ルータ
44

5-
ほとんどのシングルページアプリケーションでは、公式にサポートされている [vue-router ライブラリ](https://github.com/vuejs/vue-router)を使うことをオススメします。詳細は vue-router の[ドキュメント](https://router.vuejs.org/)を参照してください。
5+
ほとんどのシングルページアプリケーションでは、公式にサポートされている [vue-router ライブラリ](https://github.com/vuejs/vue-router-next)を使うことをオススメします。詳細は vue-router の[ドキュメント](https://next.router.vuejs.org/)を参照してください。
66

77
## スクラッチからのシンプルなルーティング
88

99
とてもシンプルなルーティングだけが必要で、フル機能のルータライブラリを使用したくない場合は、以下のようにページレベルのコンポーネントで動的にレンダリングができます。
1010

1111
```js
12+
const { createApp, h } = Vue
13+
1214
const NotFoundComponent = { template: '<p>Page not found</p>' }
1315
const HomeComponent = { template: '<p>Home page</p>' }
1416
const AboutComponent = { template: '<p>About page</p>' }
@@ -30,11 +32,11 @@ const SimpleRouter = {
3032
},
3133

3234
render() {
33-
return Vue.h(this.CurrentComponent)
35+
return h(this.CurrentComponent)
3436
}
3537
}
3638

37-
Vue.createApp(SimpleRouter).mount('#app')
39+
createApp(SimpleRouter).mount('#app')
3840
```
3941

4042
[History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API/Working_with_the_History_API) と組み合わせることで、とても基本的ですが完全に機能するクライアント側のルータを構築できます。実際に確認するには、[このサンプルアプリ](https://github.com/phanan/vue-3.0-simple-routing-example)をチェックしてみてください。

0 commit comments

Comments
 (0)