Skip to content

Commit c816e58

Browse files
committedNov 29, 2018
docs: update markdown slots
1 parent c07949d commit c816e58

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

‎packages/docs/docs/guide/markdown-slot.md

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Use the `Content` component to use the slot in the layout component:
2828
<Content slot-key="name"/>
2929
```
3030

31+
::: tip
32+
Here we are using `slot-key` instead of `slot`, because in Vue, `slot` is a reserved prop name.
33+
:::
34+
3135
## Default Slot Content
3236

3337
By default, the slot-free part of a markdown file becomes the default content of a markdown slot, which you can access directly using the `Content` component:

‎packages/docs/docs/zh/guide/markdown-slot.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ Markdown 插槽便是为了解决这一类问题。
1717
你可以通过下述的语法来定义一个具名 Markdown 插槽:
1818

1919
``` md
20-
::: slot [$name]
20+
::: slot name
2121

2222
:::
2323
```
2424

2525
在布局组件中利用 `Content` 组件来使用该插槽:
2626

2727
``` vue
28-
<Content slot="$name"/>
28+
<Content slot-key="name"/>
2929
```
3030

31+
::: tip 提示
32+
这里我们使用的是 `slot-key` 而不是 `slot`,这是因为在 Vue 中,`slot` 是一个保留的 `prop` 名。
33+
:::
34+
3135
## 插槽的默认内容
3236

3337
默认情况下,一个 Markdown 文件中的普通内容将会成为 Markdown 插槽的默认内容,你可以直接使用 `Content` 组件来访问它:

0 commit comments

Comments
 (0)
Please sign in to comment.