Skip to content

Commit

Permalink
docs: update markdown slots
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Nov 29, 2018
1 parent c07949d commit c816e58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/docs/docs/guide/markdown-slot.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Use the `Content` component to use the slot in the layout component:
<Content slot-key="name"/>
```

::: tip
Here we are using `slot-key` instead of `slot`, because in Vue, `slot` is a reserved prop name.
:::

## Default Slot Content

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:
Expand Down
8 changes: 6 additions & 2 deletions packages/docs/docs/zh/guide/markdown-slot.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ Markdown 插槽便是为了解决这一类问题。
你可以通过下述的语法来定义一个具名 Markdown 插槽:

``` md
::: slot [$name]
::: slot name

:::
```

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

``` vue
<Content slot="$name"/>
<Content slot-key="name"/>
```

::: tip 提示
这里我们使用的是 `slot-key` 而不是 `slot`,这是因为在 Vue 中,`slot` 是一个保留的 `prop` 名。
:::

## 插槽的默认内容

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

0 comments on commit c816e58

Please sign in to comment.