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
Creating a Single-page Application with Vue.js + vue-router is dead simple. With Vue.js, we are already breaking our application into components. When adding vue-router to the mix, all we need to do is map our components to the routes and let vue-router know where to render them. Here's a basic example:
3
+
Vue.js + vue-router でシングルページアプリケーションを作成するのは極めてシンプルです。Vue.js で、we are already breaking our application into components. ミックスするため vue-router を追加する時、全ての我々のコンポーネントを routes に変換し、そして、vue-router がそれらをレンダリングするのを知らせたりする必要があります。ここでは基本的な例を示します:
4
4
5
5
### HTML
6
6
7
7
```html
8
8
<divid="app">
9
9
<h1>Hello App!</h1>
10
10
<p>
11
-
<!--use v-link directive for navigation.-->
11
+
<!--ナビゲーション向けに v-link ディレクティブを使用-->
12
12
<av-link="/foo">Go to Foo</a>
13
13
<av-link="/bar">Go to Bar</a>
14
14
</p>
@@ -20,7 +20,7 @@ Creating a Single-page Application with Vue.js + vue-router is dead simple. With
20
20
### JavaScript
21
21
22
22
```js
23
-
//Define some components
23
+
//いくつかのコンポーネントを定義。
24
24
var Foo =Vue.extend({
25
25
template:'<p>This is foo!</p>'
26
26
})
@@ -29,21 +29,19 @@ var Bar = Vue.extend({
29
29
template:'<p>This is bar!</p>'
30
30
})
31
31
32
-
// The router needs a root component to render.
33
-
// For demo purposes, we will just use an empty one
34
-
// because we are using the HTML as the app template.
32
+
// router は、レンダリングするために1つの root コンポーネントが必要です。
33
+
// デモ目的向けで、app テンプレートとして HTML を使用しているため、空を使用します。
35
34
var App =Vue.extend({})
36
35
37
-
// Create a router instance.
38
-
// You can pass in additional options here, but let's
39
-
// keep it simple for now.
36
+
// router インスタンスを作成。
37
+
// ここでは追加的なオプションで渡すことができますが、今はシンプルに保っています。
40
38
var router =newVueRouter()
41
39
42
-
//Define some routes.
43
-
//Each route should map to a component. The "component" can
44
-
//either be an actual component constructor created via
45
-
//Vue.extend(), or just a component options object.
0 commit comments