UNPKG

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