Skip to content

docs: #42 Scaling Up > Routing の翻訳 #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/guide/routing.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Routing
# ルーティング

## Official Router
## 公式ルータ

For most Single Page Applications, it's recommended to use the officially-supported [vue-router library](https://github.com/vuejs/vue-router). For more details, see vue-router's [documentation](https://router.vuejs.org/).
ほとんどのシングルページアプリケーションでは、公式にサポートされている [vue-router ライブラリ](https://github.com/vuejs/vue-router)を使うことをオススメします。詳細は vue-router の[ドキュメント](https://router.vuejs.org/)を参照してください。

## Simple Routing from Scratch
## スクラッチからのシンプルなルーティング

If you only need very simple routing and do not wish to involve a full-featured router library, you can do so by dynamically rendering a page-level component like this:
とてもシンプルなルーティングだけが必要で、フル機能のルータライブラリを使用したくない場合は、以下のようにページレベルのコンポーネントで動的にレンダリングができます。

```js
const NotFoundComponent = { template: '<p>Page not found</p>' }
Expand Down Expand Up @@ -37,8 +37,8 @@ const SimpleRouter = {
Vue.createApp(SimpleRouter).mount('#app')
```

Combined with the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API/Working_with_the_History_API), you can build a very basic but fully-functional client-side router. To see that in practice, check out [this example app](https://github.com/phanan/vue-3.0-simple-routing-example).
[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)をチェックしてみてください。

## Integrating 3rd-Party Routers
## サードパーティ製ルータとの統合

If there's a 3rd-party router you prefer to use, such as [Page.js](https://github.com/visionmedia/page.js) or [Director](https://github.com/flatiron/director), integration is [similarly straightforward](https://github.com/phanan/vue-3.0-simple-routing-example/compare/master...pagejs). Here's a [complete example](https://github.com/phanan/vue-3.0-simple-routing-example/tree/pagejs) using Page.js.
[Page.js](https://github.com/visionmedia/page.js) [Director](https://github.com/flatiron/director) のようなサードパーティ製のルータを使いたい場合は、統合は[同様に簡単](https://github.com/phanan/vue-3.0-simple-routing-example/compare/master...pagejs)です。ここに、Page.js を使った[サンプル](https://github.com/phanan/vue-3.0-simple-routing-example/tree/pagejs)があります。