Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

Commit fcdb208

Browse files
authored
Merge pull request #320 from watonyweng/master
docs: component-slots.md
2 parents a5cce64 + 599685c commit fcdb208

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/guide/component-slots.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 插槽
22

3-
> 该页面假设你已经阅读过了[组件基础](component-basics.md)如果你还对组件不太了解,推荐你先阅读它。
3+
> 该页面假设你已经阅读过了[组件基础](component-basics.md)如果你对组件还不太了解,推荐你先阅读它。
44
55
## 插槽内容
66

@@ -96,17 +96,17 @@ Vue 实现了一套内容分发的 API,这套 API 的设计灵感源自 [Web C
9696

9797
> 父级模板里的所有内容都是在父级作用域中编译的;子模板里的所有内容都是在子作用域中编译的。
9898
99-
## 后备内容
99+
## 备用内容
100100

101-
有时为一个插槽设置具体的后备 (也就是默认的) 内容是很有用的,它只会在没有提供内容的时候被渲染。例如在一个 `<submit-button>` 组件中:
101+
有时为一个插槽设置具体的备用 (也就是默认的) 内容是很有用的,它只会在没有提供内容的时候被渲染。例如在一个 `<submit-button>` 组件中:
102102

103103
```html
104104
<button type="submit">
105105
<slot></slot>
106106
</button>
107107
```
108108

109-
我们可能希望这个 `<button>` 内绝大多数情况下都渲染文本“Submit”。为了将“Submit”作为后备内容,我们可以将它放在 `<slot>` 标签内:
109+
我们可能希望这个 `<button>` 内绝大多数情况下都渲染文本“Submit”。为了将“Submit”作为备用内容,我们可以将它放在 `<slot>` 标签内:
110110

111111
```html
112112
<button type="submit">
@@ -120,7 +120,7 @@ Vue 实现了一套内容分发的 API,这套 API 的设计灵感源自 [Web C
120120
<submit-button></submit-button>
121121
```
122122

123-
后备内容“Submit”将会被渲染:
123+
备用内容“Submit”将会被渲染:
124124

125125
```html
126126
<button type="submit">
@@ -136,7 +136,7 @@ Vue 实现了一套内容分发的 API,这套 API 的设计灵感源自 [Web C
136136
</submit-button>
137137
```
138138

139-
则这个提供的内容将会被渲染从而取代后备内容
139+
则这个提供的内容将会被渲染从而取代备用内容
140140

141141
```html
142142
<button type="submit">
@@ -243,7 +243,7 @@ app.component('todo-list', {
243243
})
244244
```
245245

246-
我们可能需要替换插槽以在父组件上自定义它
246+
我们可能需要替换插槽使它作用在父组件上
247247

248248
```html
249249
<todo-list>
@@ -356,7 +356,7 @@ function (slotProps) {
356356
</todo-list>
357357
```
358358

359-
你甚至可以定义后备内容,用于插槽 prop 是 undefined 的情形:
359+
你甚至可以定义备用内容,用于插槽 prop 是 undefined 的情形:
360360

361361
```html
362362
<todo-list v-slot="{ item = 'Placeholder' }">

0 commit comments

Comments
 (0)