UNPKG

811 BTypeScriptView Raw
1import { ComponentType } from 'react'
2
3interface SlotProps {
4 /** 指定插入的 slot 位置
5 * @default none
6 * @supported weapp, swan, alipay, tt, jd, qq
7 */
8 name?: string,
9 /** scoped slot 传入数据源
10 * @default none
11 * @supported swan
12 */
13 varName?: string
14}
15
16/** slot 插槽
17 * @supported weapp, swan, alipay, tt, jd, qq
18 * @example
19 * ```tsx
20 * import { Slot, View, Text } from '@tarojs/components'
21 *
22 * export default class SlotView extends Component {
23 * render () {
24 * return (
25 * <View>
26 * <custom-component>
27 * <Slot name='title'>
28 * <Text>Hello, world!</Text>
29 * </Slot>
30 * </custom-component>
31 * </View>
32 * )
33 * }
34 * }
35 * ```
36 */
37declare const Slot: ComponentType<SlotProps>
38
39export { Slot, SlotProps }
\No newline at end of file