diff --git a/packages/taro-components/types/Slot.d.ts b/packages/taro-components/types/Slot.d.ts new file mode 100644 index 000000000000..107f2bb6ed67 --- /dev/null +++ b/packages/taro-components/types/Slot.d.ts @@ -0,0 +1,39 @@ +import { ComponentType } from 'react' + +interface SlotProps { + /** 指定插入的 slot 位置 + * @default none + * @supported weapp, swan, alipay, tt, jd, qq + */ + name?: string, + /** scoped slot 传入数据源 + * @default none + * @supported swan + */ + varName?: string +} + +/** slot 插槽 + * @supported weapp, swan, alipay, tt, jd, qq + * @example + * ```tsx + * import { Slot, View, Text } from '@tarojs/components' + * + * export default class SlotView extends Component { + * render () { + * return ( + * + * + * + * Hello, world! + * + * + * + * ) + * } + * } + * ``` + */ +declare const Slot: ComponentType + +export { Slot, SlotProps } \ No newline at end of file diff --git a/packages/taro-components/types/index.d.ts b/packages/taro-components/types/index.d.ts index d7e513efcaa6..31e45646941c 100644 --- a/packages/taro-components/types/index.d.ts +++ b/packages/taro-components/types/index.d.ts @@ -42,5 +42,6 @@ export { WebView } from './WebView' export { OfficialAccount } from './OfficialAccount' export { NavigationBar } from './NavigationBar' export { PageMeta } from './PageMeta' +export { Slot } from './Slot' export * from './common' export * from './event'