-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
* <View> | ||
* <custom-component> | ||
* <Slot name='title'> | ||
* <Text>Hello, world!</Text> | ||
* </Slot> | ||
* </custom-component> | ||
* </View> | ||
* ) | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
declare const Slot: ComponentType<SlotProps> | ||
|
||
export { Slot, SlotProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters