Skip to content

Commit ae18ffd

Browse files
committed
Merge branch 'master' into 2.0-cn
* master: fix typos in guide introduction update version select update deploy URL and CNAME update example fiddles add vue-router migration guide improve Vue.extend API docs (vuejs#422) tweak index # Conflicts: # _config.yml # src/CNAME # src/guide/custom-directive.md # src/guide/migration.md # themes/vue/layout/index.ejs # themes/vue/layout/partials/sidebar.ejs
2 parents b1857bb + 5af2ed7 commit ae18ffd

23 files changed

+553
-35
lines changed

src/api/index.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,26 @@ type: api
102102

103103
Create a "subclass" of the base Vue constructor. The argument should be an object containing component options.
104104

105-
The special cases to note here are `el` and `data` options - they must be functions when used with `Vue.extend()`.
105+
The special case to note here is the `data` option - it must be a function when used with `Vue.extend()`.
106106

107107
``` html
108108
<div id="mount-point"></div>
109109
```
110110

111111
``` js
112-
// create reusable constructor
112+
// create constructor
113113
var Profile = Vue.extend({
114-
template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>'
115-
})
116-
// create an instance of Profile
117-
var profile = new Profile({
118-
data: {
119-
firstName: 'Walter',
120-
lastName: 'White',
121-
alias: 'Heisenberg'
114+
template: '<p>{{firstName}} {{lastName}} aka {{alias}}</p>',
115+
data: function () {
116+
return {
117+
firstName: 'Walter',
118+
lastName: 'White',
119+
alias: 'Heisenberg'
120+
}
122121
}
123122
})
124-
// mount it on an element
125-
profile.$mount('#mount-point')
123+
// create an instance of Profile and mount it on an element
124+
new Profile().$mount('#mount-point')
126125
```
127126

128127
Will result in:

src/examples/commits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 1
66

77
> This example fetches latest Vue.js commits data from GitHub's API and displays them as a list. You can switch between the master and dev branches.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/bqhxz70a/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/cLvadprL/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/elastic-header.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ type: examples
44
order: 7
55
---
66

7-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/9j3e7503/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
7+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/5hfsajjr/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/firebase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 2
66

77
> This example uses [Firebase](https://www.firebase.com/) as the data persistence backend and syncs between clients in real time (you can try opening it in multiple browser tabs). In addition, it performs instant validation using computed properties and triggers CSS transitions when adding/removing items.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/tggfeL33/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/7vLv44kh/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/grid-component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 3
66

77
> This is an example of creating a reusable grid component and using it with external data.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/b4mx7gd8/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/23qze30k/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 0
66

77
> Dead simple Markdown editor.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/a4kx9ark/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/v368d4g3/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 6
66

77
> Features used: component, prop passing, content insertion, transitions.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/qx3hzgkt/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/70yyx8z2/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/select2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Custom Directive
2+
title: Wrapper Component
33
type: examples
44
order: 8
55
---
66

7-
> In this example we are integrating a 3rd party jQuery plugin (select2) by wrapping it inside a custom directive.
7+
> In this example we are integrating a 3rd party jQuery plugin (select2) by wrapping it inside a custom component.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/0k1akjq1/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/j17w6kjh/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/svg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 5
66

77
> This example showcases a combination of custom component, computed property, two-way binding and SVG support.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/g6ehtyLr/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/8rj70kh1/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/todomvc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 9
66

77
> This is a fully spec-compliant TodoMVC implementation in under 120 effective lines of JavaScript (excluding comments and blank lines).
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/uvmgxff1/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/aump8a25/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/tree-view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 4
66

77
> Example of a simple tree view implementation showcasing recursive usage of components.
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/rp2dn0uh/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/5oyu4c4u/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/guide/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 对比其他框架
33
type: guide
4-
order: 25
4+
order: 26
55
---
66

77
This is definitely the most difficult page in the guide to write, but we do feel it's important. Odds are, you've had problems you tried to solve and you've used another library to solve them. You're here because you want to know if Vue can solve your specific problems better. That's what we hope to answer for you.

src/guide/custom-directive.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ directives: {
8181
- **oldValue**: 指令绑定的前一个值, 仅在 `update``componentUpdated` 钩子中可用。无论值是否改变都可用。
8282
- **expression**: 绑定值的字符串形式。 例如 `v-my-directive="1 + 1"` , expression 的值是 `"1 + 1"`
8383
- **arg**: 传给指令的参数。例如 `v-my-directive:foo`, arg 的值是 `"foo"`
84-
- **modifiers**: 一个包含编辑器的对象。 例如: `v-my-directive.foo.bar`, 编辑器对象 modifiers的值是 `{ foo: true, bar: true }`.
85-
- **vnode**: Vue 生成的虚拟节点<!--参考 [VNode API]([!!TODO: Add link to the VNode API doc when it exists]) for full details.-->
84+
- **modifiers**: 一个包含编辑器的对象。 例如: `v-my-directive.foo.bar`, 编辑器对象 modifiers的值是 `{ foo: true, bar: true }`
85+
- **vnode**: Vue 编译生成的虚拟节点, 参考 [VNode API](/api/#VNode-Interface) 详情。
8686
- **oldVnode**: 上一个虚拟节点, 仅在 `update``componentUpdated` 钩子中可用。
8787

8888
<p class="tip">除了 `el` 之外, 其它参数都应该是只读的,尽量不要修改他们。如果需要在钩子之间共享数据,建议通过元素的 [dataset] 来进行。(https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset).</p>

src/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Vue.component('todo', {
298298
var app7 = new Vue({
299299
el: '#app-7',
300300
data: {
301-
todos: [{ /* ... */}]
301+
todos: [/* ... */]
302302
}
303303
})
304304
```

src/guide/join.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 加入Vue.js社区
33
type: guide
4-
order: 26
4+
order: 27
55
---
66

77
Vue's community is growing incredibly fast and if you're reading this, there's a good chance you're ready to join it. So... welcome!

0 commit comments

Comments
 (0)