Skip to content

Commit f9c4f02

Browse files
authored
sync recent updates (vuejs#628)
* update to 2.5.11 * update sponsor logo * update sponsor logos * update sponsors * update sponsors * Avoid wrapping Support Vue menu item (#1326) * Update team.md (#1330) * Update Instance in Guide to mention Object.freeze (#1323) * update instance in guide to mention object.freeze * Small tweaks to Object.freeze example * Revert changes to spaces before parens * Add props and events diagram (#1310) * Updated style guide (#1331) Updated style guide based on Multi-attribute elements statement. * upgrade vue * fix error parsing api h3s * Update events.md (#1333) When using capture mode , parent is being handled before the children is being handled * Update shentao’s repos and work (#1335) * Update common.js * fixed bug in team.md
1 parent 6e81d2d commit f9c4f02

21 files changed

+10654
-217
lines changed

assets/props_and_events.ai

Lines changed: 7527 additions & 0 deletions
Large diffs are not rendered by default.

src/support-vuejs/index.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ Vue.js 是采用 MIT 许可的开源项目,使用完全免费。
4444
### Patreon 黄金赞助商
4545

4646
<p class="patreon-sponsors sponsor-section">
47-
<a href="https://deepstreamhub.com" target="_blank" style="width: 140px; top: 1px;">
48-
<img src="/images/deepstream.png" style="width: 140px;">
49-
</a><a href="https://jsfiddle.net">
47+
<a href="https://jsfiddle.net">
5048
<img src="/images/jsfiddle.png">
5149
</a><a href="https://laravel.com">
5250
<img src="/images/laravel.png">
@@ -64,16 +62,16 @@ Vue.js 是采用 MIT 许可的开源项目,使用完全免费。
6462
<img src="/images/vuejobs.svg">
6563
</a><a href="https://leanpub.com/vuejs2" target="_blank">
6664
<img src="/images/tmvuejs2.png">
67-
</a><a href="https://component.io" target="_blank" style="width: 140px;">
68-
<img src="/images/component_io.png" style="width: 140px;">
65+
</a><a href="https://anymod.com" target="_blank" style="width: 140px;">
66+
<img src="/images/anymod.png" style="width: 140px;">
6967
</a><a href="https://www.xfive.co/" target="_blank" style="width: 80px;">
7068
<img src="/images/xfive.png" style="width: 80px;">
71-
</a><a href="http://www.frontenddevelopermeetups.com/" target="_blank" style="width: 120px;">
72-
<img src="/images/frontend-meetups.png" style="width: 120px;">
69+
</a><a href="https://www.frontenddeveloperlove.com/" target="_blank" style="width: 150px;">
70+
<img src="/images/frontend-love.png" style="width: 150px;">
7371
</a><a href="https://onsen.io/vue/" target="_blank" style="width: 125px;">
7472
<img src="/images/onsen-ui.png" style="width: 125px;">
75-
</a><a href="https://themeforest.net/item/clear-bootstrap-vuejs-admin-template/19339739?ref=jyostna&utm_source=vuejs.org&utm_campaign=vuejs_patreon" target="_blank" style="width: 120px;">
76-
<img src="/images/vuejsadmin.png" style="width: 120px;">
73+
</a><a href="https://vuetifyjs.com" target="_blank">
74+
<img src="/images/vuetify.png">
7775
</a>
7876
</p>
7977

src/v2/api/index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ type: api
175175

176176
## 全局 API
177177

178-
<h3 id="Vue-extend">Vue.extend( options )</h3>
178+
### Vue.extend( options )
179179

180180
- **参数**
181181
- `{Object} options`
@@ -214,7 +214,7 @@ type: api
214214

215215
- **参考**[组件](../guide/components.html)
216216

217-
<h3 id="Vue-nextTick">Vue.nextTick( [callback, context] )</h3>
217+
### Vue.nextTick( [callback, context] )
218218

219219
- **参数**
220220
- `{Function} [callback]`
@@ -241,7 +241,7 @@ type: api
241241

242242
 > 2.1.0 起新增:如果没有提供回调且在支持 Promise 的环境中,则返回一个 Promise。请注意 Vue 不自带 Promise 的 polyfill,所以如果你的目标浏览器不原生支持 Promise (IE:你们都看我干嘛),你得自己提供 polyfill。
243243

244-
<h3 id="Vue-set">Vue.set( target, key, value )</h3>
244+
### Vue.set( target, key, value )
245245

246246
- **参数**
247247
- `{Object | Array} target`
@@ -256,7 +256,7 @@ type: api
256256

257257
<p class="tip">注意对象不能是 Vue 实例,或者 Vue 实例的根数据对象。</p>
258258

259-
<h3 id="Vue-delete">Vue.delete( target, key )</h3>
259+
### Vue.delete( target, key )
260260

261261
- **参数**
262262
- `{Object | Array} target`
@@ -272,7 +272,7 @@ type: api
272272
273273
 <p class="tip">目标对象不能是一个 Vue 实例或 Vue 实例的根数据对象。</p>
274274

275-
<h3 id="Vue-directive">Vue.directive( id, [definition] )</h3>
275+
### Vue.directive( id, [definition] )
276276

277277
- **参数**
278278
- `{string} id`
@@ -303,7 +303,7 @@ type: api
303303

304304
- **参考**[自定义指令](../guide/custom-directive.html)
305305

306-
<h3 id="Vue-filter">Vue.filter( id, [definition] )</h3>
306+
### Vue.filter( id, [definition] )
307307

308308
- **参数**
309309
- `{string} id`
@@ -323,7 +323,7 @@ type: api
323323
var myFilter = Vue.filter('my-filter')
324324
```
325325

326-
<h3 id="Vue-component">Vue.component( id, [definition] )</h3>
326+
### Vue.component( id, [definition] )
327327

328328
- **参数**
329329
- `{string} id`
@@ -346,7 +346,7 @@ type: api
346346

347347
- **参考**[组件](../guide/components.html)
348348

349-
<h3 id="Vue-use">Vue.use( plugin )</h3>
349+
### Vue.use( plugin )
350350

351351
- **参数**
352352
- `{Object | Function} plugin`
@@ -359,7 +359,7 @@ type: api
359359

360360
- **参考**[插件](../guide/plugins.html)
361361

362-
<h3 id="Vue-mixin">Vue.mixin( mixin )</h3>
362+
### Vue.mixin( mixin )
363363

364364
- **参数**
365365
- `{Object} mixin`
@@ -370,7 +370,7 @@ type: api
370370

371371
- **参考**[全局混合](../guide/mixins.html#全局混合)
372372

373-
<h3 id="Vue-compile">Vue.compile( template )</h3>
373+
### Vue.compile( template )
374374

375375
- **参数**
376376
- `{string} template`
@@ -393,7 +393,7 @@ type: api
393393

394394
- **参考**[渲染函数](../guide/render-function.html)
395395

396-
<h3 id="Vue-version">Vue.version</h3>
396+
### Vue.version
397397

398398
- **细节**:提供字符串形式的 Vue 安装版本号。这对社区的插件和组件来说非常有用,你可以根据不同的版本号采取不同的策略。
399399

@@ -1415,7 +1415,7 @@ type: api
14151415
14161416
## 实例方法 / 数据
14171417
1418-
<h3 id="vm-watch">vm.$watch( expOrFn, callback, [options] )</h3>
1418+
### vm.$watch( expOrFn, callback, [options] )
14191419
14201420
- **参数**:
14211421
- `{string | Function} expOrFn`
@@ -1482,7 +1482,7 @@ type: api
14821482
// 立即以 `a` 的当前值触发回调
14831483
```
14841484
1485-
<h3 id="vm-set">vm.$set( target, key, value )</h3>
1485+
### vm.$set( target, key, value )
14861486
14871487
- **参数**:
14881488
- `{Object | Array} target`
@@ -1497,7 +1497,7 @@ type: api
14971497
14981498
- **参考**:[Vue.set](#Vue-set)
14991499
1500-
<h3 id="vm-delete">vm.$delete( target, key )</h3>
1500+
### vm.$delete( target, key )
15011501
15021502
- **参数**:
15031503
- `{Object | Array} target`
@@ -1511,7 +1511,7 @@ type: api
15111511
15121512
## 实例方法 / 事件
15131513
1514-
<h3 id="vm-on">vm.$on( event, callback )</h3>
1514+
### vm.$on( event, callback )
15151515
15161516
- **参数**:
15171517
- `{string | Array<string>} event` (数组只在 2.2.0+ 中支持)
@@ -1531,7 +1531,7 @@ type: api
15311531
// => "hi"
15321532
```
15331533
1534-
<h3 id="vm-once">vm.$once( event, callback )</h3>
1534+
### vm.$once( event, callback )
15351535
15361536
- **参数**:
15371537
- `{string} event`
@@ -1541,7 +1541,7 @@ type: api
15411541
15421542
监听一个自定义事件,但是只触发一次,在第一次触发之后移除监听器。
15431543
1544-
<h3 id="vm-off">vm.$off( [event, callback] )</h3>
1544+
### vm.$off( [event, callback] )
15451545
15461546
- **参数**:
15471547
- `{string | Array<string>} event` (只在 2.2.2+ 支持数组)
@@ -1557,7 +1557,7 @@ type: api
15571557
15581558
- 如果同时提供了事件与回调,则只移除这个回调的监听器。
15591559
1560-
<h3 id="vm-emit">vm.$emit( event, [...args] )</h3>
1560+
### vm.$emit( event, [...args] )
15611561
15621562
- **参数**:
15631563
- `{string} event`
@@ -1567,7 +1567,7 @@ type: api
15671567
15681568
## 实例方法 / 生命周期
15691569
1570-
<h3 id="vm-mount">vm.$mount( [elementOrSelector] )</h3>
1570+
### vm.$mount( [elementOrSelector] )
15711571
15721572
- **参数**:
15731573
- `{Element | string} [elementOrSelector]`
@@ -1605,13 +1605,13 @@ type: api
16051605
- [生命周期图示](../guide/instance.html#生命周期图示)
16061606
- [服务端渲染](../guide/ssr.html)
16071607
1608-
<h3 id="vm-forceUpdate">vm.$forceUpdate()</h3>
1608+
### vm.$forceUpdate()
16091609
16101610
- **示例**:
16111611
16121612
迫使 Vue 实例重新渲染。注意它仅仅影响实例本身和插入插槽内容的子组件,而不是所有子组件。
16131613
1614-
<h3 id="vm-nextTick">vm.$nextTick( [callback] )</h3>
1614+
### vm.$nextTick( [callback] )
16151615
16161616
- **参数**:
16171617
- `{Function} [callback]`
@@ -1645,7 +1645,7 @@ type: api
16451645
16461646
- **参考**:[Vue.nextTick](#Vue-nextTick)
16471647
1648-
<h3 id="vm-destroy">vm.$destroy()</h3>
1648+
### vm.$destroy()
16491649
16501650
- **用法**:
16511651

src/v2/guide/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ methods: {
188188
<form v-on:submit.prevent></form>
189189

190190
<!-- 添加事件监听器时使用事件捕获模式 -->
191-
<!-- 即内部元素触发的事件先在此处处理,然后才交由内部元素自身进行处理 -->
191+
<!-- 即元素自身触发的事件先在此处处理,然后才交由内部元素进行处理 -->
192192
<div v-on:click.capture="doThis">...</div>
193193

194194
<!-- 只当在 event.target 是当前元素自身时触发处理函数 -->

src/v2/guide/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
title: 安装
33
type: guide
44
order: 1
5-
vue_version: 2.5.9
6-
gz_size: "30.95"
5+
vue_version: 2.5.13
6+
gz_size: "30.67"
77
---
88

99
### 兼容性

src/v2/guide/instance.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ order: 3
88

99
每个 Vue 应用都是通过 `Vue` 函数创建一个新的 **Vue 实例**开始的:
1010

11-
``` js
11+
```js
1212
var vm = new Vue({
1313
// 选项
1414
})
@@ -37,7 +37,7 @@ Root Instance
3737

3838
当一个 Vue 实例被创建时,它向 Vue 的**响应式系统**中加入了其 `data` 对象中能找到的所有的属性。当这些属性的值发生改变时,视图将会产生“响应”,即匹配更新为新的值。
3939

40-
``` js
40+
```js
4141
// 我们的数据对象
4242
var data = { a: 1 }
4343

@@ -60,13 +60,13 @@ vm.a // => 3
6060

6161
当这些数据改变时,视图会进行重渲染。值得注意的是只有当实例被创建时 `data` 中存在的属性是**响应式**的。也就是说如果你添加一个新的属性,像:
6262

63-
``` js
63+
```js
6464
vm.b = 'hi'
6565
```
6666

6767
那么对 `b` 的改动将不会触发任何视图的更新。如果你知道你会在晚些时候需要一个属性,但是一开始它为空或不存在,那么你仅需要设置一些初始值。比如:
6868

69-
``` js
69+
```js
7070
data: {
7171
newTodoText: '',
7272
visitCount: 0,
@@ -76,9 +76,36 @@ data: {
7676
}
7777
```
7878

79+
这里唯一的例外是使用 `Object.freeze()` 防止修改现有的属性,这意味着响应系统无法_追踪_变化了。
80+
81+
```js
82+
var obj = {
83+
foo: 'bar'
84+
}
85+
86+
Object.freeze(obj)
87+
88+
new Vue({
89+
el: '#app',
90+
data () {
91+
return {
92+
obj
93+
}
94+
}
95+
})
96+
```
97+
98+
```html
99+
<div id="app">
100+
<p>{{ obj.foo }}</p>
101+
<!-- 这里的 `obj.foo` 不会更新! -->
102+
<button @click="obj.foo = 'baz'">Change it</button>
103+
</div>
104+
```
105+
79106
除了 data 属性,Vue 实例暴露了一些有用的实例属性与方法。它们都有前缀 `$`,以便与用户定义的属性区分开来。例如:
80107

81-
``` js
108+
```js
82109
var data = { a: 1 }
83110
var vm = new Vue({
84111
el: '#example',
@@ -102,7 +129,7 @@ vm.$watch('a', function (newValue, oldValue) {
102129

103130
比如 [`created`](../api/#created) 钩子可以用来在一个实例被创建之后执行代码:
104131

105-
``` js
132+
```js
106133
new Vue({
107134
data: {
108135
a: 1

src/v2/guide/team.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ order: 803
198198
'Annecy, France': [45.899247, 6.129384],
199199
'Alicante, Spain' : [38.346543, -0.483838],
200200
'Bangalore, India': [12.971599, 77.594563],
201+
'Beijing, China': [39.913818, 116.363625],
201202
'Bordeaux, France': [44.837789, -0.579180],
202203
'Bucharest, Romania': [44.426767, 26.102538],
203204
'Chengdu, China': [30.572815, 104.066801],
@@ -591,12 +592,25 @@ order: 803
591592
github: 'shentao',
592593
twitter: 'DamianDulisz',
593594
work: {
594-
role: 'Senior Frontend Developer',
595-
org: 'Monterail',
596-
orgUrl: 'https://www.monterail.com/'
595+
role: 'Consultant'
597596
},
598597
reposPersonal: [
599-
'monterail/vue-multiselect', 'monterail/vue-newsletter'
598+
'shentao/vue-multiselect'
599+
]
600+
},
601+
{
602+
name: 'kingwl',
603+
title: 'New Bee',
604+
city: 'Beijing, China',
605+
languages: ['zh'],
606+
work: {
607+
role: 'Software Development Engineer',
608+
org: 'Chaitin',
609+
orgUrl: 'https://chaitin.cn/'
610+
},
611+
github: 'kingwl',
612+
reposOfficial: [
613+
'vue'
600614
]
601615
}
602616
]))

src/v2/style-guide/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,10 @@ computed: {
17141714
#### 好例子
17151715

17161716
``` html
1717-
<div v-if="error" key="search-status">
1717+
<div
1718+
v-if="error"
1719+
key="search-status"
1720+
>
17181721
错误:{{ error }}
17191722
</div>
17201723
<div v-else key="search-results">

themes/vue/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
site_description: "Vue.js - The Progressive JavaScript Framework"
22
google_analytics: UA-46852172-3
33
root_domain: cn.vuejs.org
4-
vue_version: 2.5.9
4+
vue_version: 2.5.13

0 commit comments

Comments
 (0)