File tree Expand file tree Collapse file tree 6 files changed +44
-12
lines changed
packages/components/drawer Expand file tree Collapse file tree 6 files changed +44
-12
lines changed Original file line number Diff line number Diff line change @@ -10,15 +10,23 @@ style | Object | - | CSS(Cascading Style Sheets) | N
1010custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
1111close-on-overlay-click | Boolean | true | \- | N
1212destroy-on-close | Boolean | false | \- | N
13- footer | Slot | - | ` 0.29.0 ` 。 [ see more ts definition ] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts ) | N
13+
1414items | Array | - | Typescript:` DrawerItem[] ` ` interface DrawerItem { title: string; icon: string; } ` 。[ see more ts definition] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts ) | N
15+ overlay-props | Object | {} | Typescript:` OverlayProps ` ,[ Overlay API Documents] ( ./overlay?tab=api ) 。[ see more ts definition] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts ) | N
1516placement | String | right | options: left/right | N
1617show-overlay | Boolean | true | \- | N
17- title | String / Slot | - | ` 0.29.0 ` 。 [ see more ts definition ] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts ) | N
18+ title | String | - | ` 0.29.0 ` | N
1819using-custom-navbar | Boolean | false | \- | N
1920visible | Boolean | false | \- | N
2021z-index | Number | 11500 | \- | N
2122
23+ ### Drawer Slots
24+
25+ name | Description
26+ -- | --
27+ footer | ` 0.29.0 `
28+ title | ` 0.29.0 `
29+
2230### Drawer Events
2331
2432name | params | description
Original file line number Diff line number Diff line change @@ -53,15 +53,23 @@ style | Object | - | 样式 | N
5353custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
5454close-on-overlay-click | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N
5555destroy-on-close | Boolean | false | 抽屉关闭时是否销毁节点 | N
56- footer | Slot | - | ` 0.29.0 ` 。抽屉的底部。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts ) | N
56+
5757items | Array | - | 抽屉里的列表项。TS 类型:` DrawerItem[] ` ` interface DrawerItem { title: string; icon: string; } ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts ) | N
58+ overlay-props | Object | {} | 遮罩层的属性,透传至 overlay。TS 类型:` OverlayProps ` ,[ Overlay API Documents] ( ./overlay?tab=api ) 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts ) | N
5859placement | String | right | 抽屉方向。可选项:left/right | N
5960show-overlay | Boolean | true | 是否显示遮罩层 | N
60- title | String / Slot | - | ` 0.29.0 ` 。抽屉的标题。 [ 通用类型定义 ] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts ) | N
61+ title | String | - | ` 0.29.0 ` 。抽屉的标题 | N
6162using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
6263visible | Boolean | false | 组件是否可见 | N
6364z-index | Number | 11500 | 抽屉层级,样式默认为 11500 | N
6465
66+ ### Drawer Slots
67+
68+ 名称 | 描述
69+ -- | --
70+ footer | ` 0.29.0 ` 。抽屉的底部
71+ title | ` 0.29.0 ` 。抽屉的标题
72+
6573### Drawer Events
6674
6775名称 | 参数 | 描述
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default class Drawer extends SuperComponent {
2424
2525 methods = {
2626 // closeOnOverlayClick为true时才能触发popup的visible-change事件
27- visibleChange ( { detail } ) {
27+ onVisibleChange ( { detail } ) {
2828 const { visible } = detail ;
2929 const { showOverlay } = this . data ;
3030
@@ -41,7 +41,7 @@ export default class Drawer extends SuperComponent {
4141 }
4242 } ,
4343
44- itemClick ( detail ) {
44+ onItemClick ( detail ) {
4545 const { index, item } = detail . currentTarget . dataset ;
4646
4747 this . triggerEvent ( 'item-click' , { index, item } ) ;
Original file line number Diff line number Diff line change 44 wx:if="{{!destroyOnClose || visible}}"
55 style="{{_._style([style, customStyle])}}"
66 class="class"
7- bind:visible-change="visibleChange"
87 visible="{{visible}}"
9- zIndex ="{{zIndex}}"
10- usingCustomNavbar ="{{usingCustomNavbar}}"
8+ z-index ="{{zIndex}}"
9+ using-custom-navbar ="{{usingCustomNavbar}}"
1110 placement="{{placement == 'right' ? 'right' : 'left'}}"
12- showOverlay="{{showOverlay}}"
13- closeOnOverlayClick="{{closeOnOverlayClick}}"
11+ show-overlay="{{showOverlay}}"
12+ overlay-props="{{overlayProps}}"
13+ close-on-click-overlay="{{closeOnOverlayClick}}"
14+ bind:visible-change="onVisibleChange"
1415>
1516 <view class="{{classPrefix}}">
1617 <slot name="title" />
2627 wx:key="index"
2728 data-item="{{item}}"
2829 data-index="{{index}}"
29- bindtap="itemClick"
3030 aria-role="{{ ariaRole || 'button' }}"
3131 aria-label="{{item.title}}"
32+ bindtap="onItemClick"
3233 >
3334 <view aria-hidden="{{true}}" wx:if="{{item.icon}}" class="{{classPrefix}}__sidebar-item-icon">
3435 <t-icon name="{{item.icon}}" />
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ const props: TdDrawerProps = {
2020 items : {
2121 type : Array ,
2222 } ,
23+ /** 遮罩层的属性,透传至 overlay */
24+ overlayProps : {
25+ type : Object ,
26+ value : { } ,
27+ } ,
2328 /** 抽屉方向 */
2429 placement : {
2530 type : String ,
Original file line number Diff line number Diff line change 44 * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55 * */
66
7+ import { OverlayProps } from '../overlay/index' ;
8+
79export interface TdDrawerProps {
810 /**
911 * 点击蒙层时是否触发抽屉关闭事件
@@ -28,6 +30,14 @@ export interface TdDrawerProps {
2830 type : ArrayConstructor ;
2931 value ?: DrawerItem [ ] ;
3032 } ;
33+ /**
34+ * 遮罩层的属性,透传至 overlay
35+ * @default {}
36+ */
37+ overlayProps ?: {
38+ type : ObjectConstructor ;
39+ value ?: OverlayProps ;
40+ } ;
3141 /**
3242 * 抽屉方向
3343 * @default right
You can’t perform that action at this time.
0 commit comments