Skip to content

Commit

Permalink
Feat/picker-zindex (#1985)
Browse files Browse the repository at this point in the history
* feat: picker添加层级控制

* refactor: 修改popupProps的处理逻辑

* refactor: fix template error

* fix: picker compile error
  • Loading branch information
favouredddd authored May 11, 2023
1 parent 2d13cc6 commit 3639313
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/picker/picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default class Picker extends SuperComponent {
classPrefix: name,
labelAlias: 'label',
valueAlias: 'value',
defaultPopUpProps: {},
defaultPopUpzIndex: 11500,
};

methods = {
Expand Down
9 changes: 8 additions & 1 deletion src/picker/picker.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<wxs src="../common/utils.wxs" module="_" />

<t-popup class="class" visible="{{visible}}" placement="bottom" bind:visible-change="onPopupChange">
<t-popup
class="class"
visible="{{visible}}"
placement="bottom"
bind:visible-change="onPopupChange"
z-index="{{ popupProps.zIndex || defaultPopUpzIndex }}"
overlay-props="{{ popupProps.overlayProps || defaultPopUpProps }}"
>
<view slot="content" style="{{_._style([style, customStyle])}}" class="{{classPrefix}} {{prefix}}-class">
<view class="{{classPrefix}}__toolbar" wx:if="{{header}}">
<view class="{{classPrefix}}__cancel {{prefix}}-class-cancel" wx:if="{{cancelBtn}}" bindtap="onCancel"
Expand Down
5 changes: 5 additions & 0 deletions src/picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ const props: TdPickerProps = {
type: Boolean,
value: false,
},
/** popupProps透传 */
popupProps: {
type: Object,
value: {},
},
};

export default props;
8 changes: 8 additions & 0 deletions src/picker/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ export interface TdPickerProps {
type: BooleanConstructor;
value?: boolean;
};
/**
* popup组件样式
* @default {}
*/
popupProps: {
type: object;
value?: {};
};
}

export type PickerValue = string | number;

0 comments on commit 3639313

Please sign in to comment.