Skip to content

Commit 48b8aea

Browse files
committed
fixed some anchors in new component docs
1 parent c642bac commit 48b8aea

File tree

7 files changed

+33
-29
lines changed

7 files changed

+33
-29
lines changed

src/v2/api/index.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ type: api
734734

735735
- **参考**
736736
- [生命周期图示](../guide/instance.html#生命周期图示)
737-
- [用插槽分发内容](../guide/components.html#使用插槽分发内容)
737+
- [通过插槽分发内容](../guide/components.html#通过插槽分发内容)
738738

739739
### render
740740

@@ -885,7 +885,7 @@ type: api
885885
886886
- **参考**:
887887
- [构建组件 - keep-alive](#keep-alive)
888-
- [动态组件 - keep-alive](../guide/components.html#keep-alive)
888+
- [动态组件 - keep-alive](../guide/components-dynamic-async.html#在动态组件上使用-keep-alive)
889889
890890
### deactivated
891891
@@ -899,7 +899,7 @@ type: api
899899
900900
- **参考**:
901901
- [构建组件 - keep-alive](#keep-alive)
902-
- [动态组件 - keep-alive](../guide/components.html#keep-alive)
902+
- [动态组件 - keep-alive](../guide/components-dynamic-async.html#在动态组件上使用-keep-alive)
903903
904904
### beforeDestroy
905905
@@ -1379,7 +1379,7 @@ type: api
13791379
13801380
- **详细**:
13811381
1382-
用来访问被[插槽分发](../guide/components.html#使用插槽分发内容)的内容。每个[具名插槽](../guide/components.html#具名插槽) 有其相应的属性 (例如:`slot="foo"` 中的内容将会在 `vm.$slots.foo` 中被找到)。`default` 属性包括了所有没有被包含在具名插槽中的节点。
1382+
用来访问被[插槽分发](../guide/components.html#通过插槽分发内容)的内容。每个[具名插槽](../guide/components-slots.html#具名插槽) 有其相应的属性 (例如:`slot="foo"` 中的内容将会在 `vm.$slots.foo` 中被找到)。`default` 属性包括了所有没有被包含在具名插槽中的节点。
13831383
13841384
在使用[渲染函数](../guide/render-function.html)书写一个组件时,访问 `vm.$slots` 最有帮助。
13851385
@@ -1418,7 +1418,7 @@ type: api
14181418
14191419
- **参考**:
14201420
- [`<slot>` 组件](#slot-1)
1421-
- [使用插槽分发内容](../guide/components.html#使用插槽分发内容)
1421+
- [通过插槽分发内容](../guide/components.html#通过插槽分发内容)
14221422
- [渲染函数 - 插槽](../guide/render-function.html#插槽)
14231423
14241424
### vm.$scopedSlots
@@ -1431,7 +1431,7 @@ type: api
14311431
14321432
- **详细**:
14331433
1434-
用来访问[作用域插槽](../guide/components.html#作用域插槽)。对于包括 `默认 slot` 在内的每一个插槽,该对象都包含一个返回相应 VNode 的函数。
1434+
用来访问[作用域插槽](../guide/components-slots.html#作用域插槽)。对于包括 `默认 slot` 在内的每一个插槽,该对象都包含一个返回相应 VNode 的函数。
14351435
14361436
 `vm.$scopedSlots` 在使用[渲染函数](../guide/render-function.html)开发一个组件时特别有用。
14371437
@@ -1443,7 +1443,7 @@ type: api
14431443
14441444
- **参考**:
14451445
- [`<slot>` 组件](#slot-1)
1446-
- [作用域插槽](../guide/components.html#作用域插槽)
1446+
- [作用域插槽](../guide/components-slots.html#作用域插槽)
14471447
- [渲染函数 - 插槽](../guide/render-function.html#插槽)
14481448
14491449
### vm.$refs
@@ -1457,7 +1457,7 @@ type: api
14571457
一个对象,持有注册过 [`ref` 特性](#ref) 的所有 DOM 元素和组件实例。
14581458
14591459
- **参考**:
1460-
- [子组件引用](../guide/components.html#子组件索引)
1460+
- [子组件引用](../guide/components-edge-cases.html#访问子组件实例或子元素)
14611461
- [特殊特性 - ref](#ref)
14621462
14631463
### vm.$isServer
@@ -2117,7 +2117,7 @@ type: api
21172117
21182118
- **参考**:
21192119
- [事件处理器](../guide/events.html)
2120-
- [组件 - 自定义事件](../guide/components.html#自定义事件)
2120+
- [组件 - 自定义事件](../guide/components.html#监听子组件事件)
21212121
21222122
### v-bind
21232123
@@ -2195,8 +2195,8 @@ type: api
21952195
21962196
- **参考**:
21972197
- [Class 与 Style 绑定](../guide/class-and-style.html)
2198-
- [组件 - Props](../guide/components.html#Props)
2199-
- [组件 - `.sync` 修饰符](../guide/components.html#sync-修饰符)
2198+
- [组件 - Props](../guide/components.html#通过-Prop-向子组件传递数据)
2199+
- [组件 - `.sync` 修饰符](../guide/components-custom-events.html#sync-修饰符)
22002200
22012201
### v-model
22022202
@@ -2219,7 +2219,7 @@ type: api
22192219
22202220
- **参考**:
22212221
- [表单控件绑定](../guide/forms.html)
2222-
- [组件 - 在输入组件上使用自定义事件](../guide/components.html#使用自定义事件的表单输入组件)
2222+
- [组件 - 在输入组件上使用自定义事件](../guide/components-custom-events.html#将原生事件绑定到组件)
22232223
22242224
### v-slot
22252225
@@ -2338,7 +2338,7 @@ type: api
23382338
23392339
- **参考**:
23402340
- [数据绑定语法- 插值](../guide/syntax.html#插值)
2341-
- [组件 - 对低开销的静态组件使用 `v-once`](../guide/components.html#对低开销的静态组件使用-v-once)
2341+
- [组件 - 对低开销的静态组件使用 `v-once`](../guide/components-edge-cases.html#通过-v-once-创建低开销的静态组件)
23422342
23432343
## 特殊特性
23442344
@@ -2391,13 +2391,13 @@ type: api
23912391
23922392
关于 ref 注册时间的重要说明:因为 ref 本身是作为渲染结果被创建的,在初始渲染的时候你不能访问它们 - 它们还不存在!`$refs` 也不是响应式的,因此你不应该试图用它在模板中做数据绑定。
23932393
2394-
- **参考**:[子组件 Refs](../guide/components-edge-cases.html#访问子组件实例或子元素)
2394+
- **参考**:[子组件引用](../guide/components-edge-cases.html#访问子组件实例或子元素)
23952395
23962396
### is
23972397
23982398
- **预期**:`string | Object (组件的选项对象)`
23992399
2400-
 用于[动态组件](../guide/components.html#动态组件)且基于 [DOM 内模板的限制](../guide/components.html#DOM-模板解析说明)来工作。
2400+
 用于[动态组件](../guide/components.html#动态组件)且基于 [DOM 内模板的限制](../guide/components.html#解析-DOM-模板时的注意事项)来工作。
24012401
24022402
示例:
24032403
@@ -2416,7 +2416,7 @@ type: api
24162416
24172417
- **See also**:
24182418
- [动态组件](../guide/components.html#动态组件)
2419-
- [DOM 模板解析说明](../guide/components.html#DOM-模板解析说明)
2419+
- [DOM 模板解析说明](../guide/components.html#解析-DOM-模板时的注意事项)
24202420
24212421
### slot <sup style="color:#c92222">废弃</sup>
24222422
@@ -2426,7 +2426,7 @@ type: api
24262426
24272427
用于标记往哪个具名插槽中插入子组件内容。
24282428
2429-
- **参考**:[具名插槽](../guide/components.html#具名插槽)
2429+
- **参考**:[具名插槽](../guide/components-slots.html#具名插槽)
24302430
24312431
### slot-scope <sup style="color:#c92222">废弃</sup>
24322432
@@ -2440,7 +2440,7 @@ type: api
24402440
24412441
此属性不支持动态绑定。
24422442
2443-
- **参考**:[作用域插槽](../guide/components.html#作用域插槽)
2443+
- **参考**:[作用域插槽](../guide/components-slots.html#作用域插槽)
24442444
24452445
### scope <sup style="color:#c92222">移除</sup>
24462446
@@ -2649,7 +2649,7 @@ type: api
26492649
26502650
<p class="tip">`<keep-alive>` 不会在函数式组件中正常工作,因为它们没有缓存实例。</p>
26512651
2652-
- **参考**:[动态组件 - keep-alive](../guide/components.html#keep-alive)
2652+
- **参考**:[动态组件 - keep-alive](../guide/components-dynamic-async.html#在动态组件上使用-keep-alive)
26532653
26542654
### slot
26552655
@@ -2662,7 +2662,7 @@ type: api
26622662
26632663
详细用法,请参考下面教程的链接。
26642664
2665-
- **参考**:[使用插槽分发内容](../guide/components.html#使用插槽分发内容)
2665+
- **参考**:[通过插槽分发内容](../guide/components.html#通过插槽分发内容)
26662666
26672667
## VNode 接口
26682668

src/v2/guide/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Ember 是一个全能框架。它提供了大量的约定,一旦你熟悉了
211211

212212
Knockout 是 MVVM 领域内的先驱,并且追踪依赖。它的响应系统和 Vue 也很相似。它在[浏览器支持](http://knockoutjs.com/documentation/browser-support.html)以及其他方面的表现也是让人印象深刻的。它最低能支持到 IE6,而 Vue 最低只能支持到 IE9。
213213

214-
随着时间的推移,Knockout 的发展已有所放缓,并且略显有点老旧了。比如,它的组件系统缺少完备的生命周期事件方法,尽管这些在现在是非常常见的。以及相比于 [Vue](components.html#使用插槽分发内容) 调用子组件的接口它的方法显得有点笨重。
214+
随着时间的推移,Knockout 的发展已有所放缓,并且略显有点老旧了。比如,它的组件系统缺少完备的生命周期事件方法,尽管这些在现在是非常常见的。以及相比于 [Vue](components.html#通过插槽分发内容) 调用子组件的接口它的方法显得有点笨重。
215215

216216
如果你有兴趣研究,你还会发现二者在接口设计的理念上是不同的。这可以通过各自创建的 [simple Todo List](https://gist.github.com/chrisvfritz/9e5f2d6826af00fcbace7be8f6dccb89) 体现出来。或许有点主观,但是很多人认为 Vue 的 API 接口更简单结构更优雅。
217217

src/v2/guide/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,4 +410,4 @@ vm.selected.number // => 123
410410

411411
> 如果你还不熟悉 Vue 的组件,可以暂且跳过这里。
412412
413-
HTML 原生的输入元素类型并不总能满足需求。幸好,Vue 的组件系统允许你创建具有完全自定义行为且可复用的输入组件。这些输入组件甚至可以和 `v-model` 一起使用!要了解更多,请参阅组件指南中的[自定义输入组件](components.html#在组件上使用-v-model)
413+
HTML 原生的输入元素类型并不总能满足需求。幸好,Vue 的组件系统允许你创建具有完全自定义行为且可复用的输入组件。这些输入组件甚至可以和 `v-model` 一起使用!要了解更多,请参阅组件指南中的[自定义输入组件](components-custom-events.html#自定义组件的-v-model)

src/v2/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Vue.component('todo-item', {
294294
</ol>
295295
```
296296

297-
但是这样会为每个待办项渲染同样的文本,这看起来并不炫酷。我们应该能从父作用域将数据传到子组件才对。让我们来修改一下组件的定义,使之能够接受一个 [prop](components.html#Props)
297+
但是这样会为每个待办项渲染同样的文本,这看起来并不炫酷。我们应该能从父作用域将数据传到子组件才对。让我们来修改一下组件的定义,使之能够接受一个 [prop](components.html#通过-Prop-向子组件传递数据)
298298

299299
``` js
300300
Vue.component('todo-item', {

src/v2/guide/migration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ computed: {
287287

288288
Props 现在只能单向传递。为了对父组件产生反向影响,子组件需要显式地传递一个事件而不是依赖于隐式地双向绑定。详见:
289289

290-
- [自定义组件事件](components.html#自定义事件)
291-
- [自定义输入组件](components.html#使用自定义事件的表单输入组件) (使用组件事件)
290+
- [自定义组件事件](components.html#监听子组件事件)
291+
- [自定义输入组件](components-custom-events.html#将原生事件绑定到组件) (使用组件事件)
292292
- [全局状态管理](state-management.html)
293293

294294
{% raw %}
@@ -302,8 +302,8 @@ Props 现在只能单向传递。为了对父组件产生反向影响,子组
302302

303303
Props 现在只能单向传递。为了对父组件产生反向影响,子组件需要显式地传递一个事件而不是依赖于隐式地双向绑定。详见:
304304

305-
- [自定义组件事件](components.html#自定义事件)
306-
- [自定义输入组件](components.html#使用自定义事件的表单输入组件) (使用组件事件)
305+
- [自定义组件事件](components.html#监听子组件事件)
306+
- [自定义输入组件](components-custom-events.html#将原生事件绑定到组件) (使用组件事件)
307307
- [全局状态管理](state-management.html)
308308

309309
{% raw %}
@@ -787,7 +787,7 @@ Vue.config.keyCodes.f1 = 112
787787

788788
对于`$dispatch``$broadcast`最简单的升级方式就是:通过使用事件中心,允许组件自由交流,无论组件处于组件树的哪一层。由于 Vue 实例实现了一个事件分发接口,你可以通过实例化一个空的 Vue 实例来实现这个目的。
789789

790-
这些方法的最常见用途之一是父子组件的相互通信。在这些情况下,你可以使用 [`v-on`监听子组件上 $emit 的变化](components.html#使用自定义事件的表单输入组件)。这可以允许你很方便的添加事件显性。
790+
这些方法的最常见用途之一是父子组件的相互通信。在这些情况下,你可以使用 [`v-on`监听子组件上 $emit 的变化](components-custom-events.html#将原生事件绑定到组件)。这可以允许你很方便的添加事件显性。
791791

792792
然而,如果是跨多层父子组件通信的话,`$emit` 并没有什么用。相反,用集中式的事件中间件可以做到简单的升级。这会让组件之间的通信非常顺利,即使是兄弟组件。因为 Vue 通过事件发射器接口执行实例,实际上你可以使用一个空的 Vue 实例。
793793

src/v2/style-guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ new Vue({
188188
</summary>
189189
{% endraw %}
190190

191-
细致的 [prop 定义](../guide/components.html#Prop-验证)有两个好处:
191+
细致的 [prop 定义](../guide/components-props.html#Prop-验证)有两个好处:
192192

193193
- 它们写明了组件的 API,所以很容易看懂组件的用法;
194194
- 在开发环境下,如果向一个组件提供格式不正确的 prop,Vue 将会告警,以帮助你捕获潜在的错误来源。

themes/vue/source/js/common.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
'全局注册': '/v2/guide/components-registration.html#全局注册',
2626
'局部注册': '/v2/guide/components-registration.html#局部注册',
2727
'DOM-模板解析注意事项': '/v2/guide/components.html#解析-DOM-模板时的注意事项',
28+
'DOM-模板解析说明': '/v2/guide/components.html#解析-DOM-模板时的注意事项',
2829
'data-必须是函数': '/v2/guide/components.html#data-必须是一个函数',
2930
'组件组合': '/v2/guide/components.html#组件的组织',
3031
'Prop': '/v2/guide/components.html#通过-Prop-向子组件传递数据',
32+
'Props': '/v2/guide/components.html#通过-Prop-向子组件传递数据',
3133
'使用-Prop-传递数据': '/v2/guide/components.html#通过-Prop-向子组件传递数据',
3234
'camelCase-vs-kebab-case': '/v2/guide/components-props.html#Prop-的大小写-camelCase-vs-kebab-case',
3335
'动态-Prop': '/v2/guide/components-props.html#静态的和动态的-Prop',
@@ -42,6 +44,7 @@
4244
'sync-修饰符': '/v2/guide/components-custom-events.html#sync-修饰符',
4345
'使用自定义事件的表单输入组件': '/v2/guide/components-custom-events.html#将原生事件绑定到组件',
4446
'自定义组件的-v-model': '/v2/guide/components-custom-events.html#自定义组件的-v-model',
47+
'在组件上使用-v-model': '/v2/guide/components-custom-events.html#自定义组件的-v-model',
4548
'非父子组件的通信': '/v2/guide/state-management.html',
4649
'使用插槽分发内容': '/v2/guide/components.html#通过插槽分发内容',
4750
'编译作用域': '/v2/guide/components-slots.html#编译作用域',
@@ -53,6 +56,7 @@
5356
'杂项': '/v2/guide/components-edge-cases.html',
5457
'编写可复用组件': '/v2/guide/components.html#组件的组织',
5558
'子组件引用': '/v2/guide/components-edge-cases.html#访问子组件实例或子元素',
59+
'子组件索引': '/v2/guide/components-edge-cases.html#访问子组件实例或子元素',
5660
'异步组件': '/v2/guide/components-dynamic-async.html#异步组件',
5761
'高级异步组件': '/v2/guide/components-dynamic-async.html#处理加载状态',
5862
'组件命名约定': '/v2/guide/components-registration.html#组件名',

0 commit comments

Comments
 (0)