提交 b39e8add 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

docs(uni-app x): slot

上级 1a5dce71
......@@ -129,20 +129,20 @@ uts中有2种方式使用json数据:
```ts
// components/Foo.uvue
<view>
<slot name="test name" />
<slot msg="test msg" />
</view>
import { SlotsType } from 'vue'
export default {
slots: Object as SlotsType<{
default: { name: string }
default: { msg: string }
}>
}
// page.uvue
<view>
<Foo>
<template v-slot="slotProps">
<text>{{ slotProps.name }}</text>
<text>{{ slotProps.msg }}</text>
</template>
</Foo>
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册