Skip to content

Commit

Permalink
Prefer using description-style components instead of constructor-styl…
Browse files Browse the repository at this point in the history
…e components (vuejs#500)
  • Loading branch information
simplesmiler authored and yyx990803 committed Jun 14, 2016
1 parent 47049a7 commit b3e9495
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions docs/en/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ Creating a Single-page Application with Vue.js + vue-router is dead simple. With
Vue.use(VueRouter)

// Define some components
var Foo = Vue.extend({
var Foo = {
template: '<p>This is foo!</p>'
})
}

var Bar = Vue.extend({
var Bar = {
template: '<p>This is bar!</p>'
})
}

// The router needs a root component to render.
// For demo purposes, we will just use an empty one
// because we are using the HTML as the app template.
// !! Note that the App is not a Vue instance.
var App = Vue.extend({})
var App = {}

// Create a router instance.
// You can pass in additional options here, but let's
Expand Down
4 changes: 2 additions & 2 deletions docs/en/nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ router.map({
Similarly, a rendered component can also contain its own, nested `<router-view>`. For example, if we add one inside the `Foo` component's template:

``` js
var Foo = Vue.extend({
var Foo = {
template:
'<div class="foo">' +
'<h2>This is Foo!</h2>' +
'<router-view></router-view>' + // <- nested outlet
'</div>'
})
}
```

To render components into this nested outlet, we need to update our route config:
Expand Down
10 changes: 5 additions & 5 deletions docs/ja/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Vue.js + vue-router でシングルページアプリケーションを作成す

``` js
// いくつかのコンポーネントを定義します
var Foo = Vue.extend({
var Foo = {
template: '<p>This is foo!</p>'
})
}

var Bar = Vue.extend({
var Bar = {
template: '<p>This is bar!</p>'
})
}

// router は、レンダリングするために1つの root コンポーネントが必要です
// デモ目的向けで、app テンプレートとして HTML を使用しているため、空を使用します
var App = Vue.extend({})
var App = {}

// router インスタンスを作成。
// ここでは追加的なオプションで渡すことができますが、今はシンプルに保っています
Expand Down
4 changes: 2 additions & 2 deletions docs/ja/nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ router.map({
同様に、レンダリングされたコンポーネントは、独自のネストされた `<router-view>` を含むことができます。例えば、`Foo` コンポーネントのテンプレート内部に1つ追加する場合:

``` js
var Foo = Vue.extend({
var Foo = {
template:
'<div class="foo">' +
'<h2>This is Foo!</h2>' +
'<router-view></router-view>' + // <- nested outlet
'</div>'
})
}
```

このネストされた outlet でコンポーネントをレンダリングするため、我々の route 設定を更新する必要があります:
Expand Down
10 changes: 5 additions & 5 deletions docs/zh-cn/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@

``` js
// 定义组件
var Foo = Vue.extend({
var Foo = {
template: '<p>This is foo!</p>'
})
}

var Bar = Vue.extend({
var Bar = {
template: '<p>This is bar!</p>'
})
}

// 路由器需要一个根组件。
// 出于演示的目的,这里使用一个空的组件,直接使用 HTML 作为应用的模板
var App = Vue.extend({})
var App = {}

// 创建一个路由器实例
// 创建实例时可以传入配置参数进行定制,为保持简单,这里使用默认配置
Expand Down
4 changes: 2 additions & 2 deletions docs/zh-cn/nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ router.map({
同样的,组件内部也可以包含自己的外链,嵌套的 `<router-view>` 。例如,如果我们在组件 `Foo` 的模板中添加了一个:

``` js
var Foo = Vue.extend({
var Foo = {
template:
'<div class="foo">' +
'<h2>This is Foo!</h2>' +
'<router-view></router-view>' + // <- 嵌套的外链
'</div>'
})
}
```

为了能够在这个嵌套的外链中渲染相应的组件,我们需要更新我们的路由配置:
Expand Down

0 comments on commit b3e9495

Please sign in to comment.