File tree Expand file tree Collapse file tree 8 files changed +31
-14
lines changed Expand file tree Collapse file tree 8 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ name | type | default | description | required
88-- | -- | -- | -- | --
99style | Object | - | CSS(Cascading Style Sheets) | N
1010custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
11+ auto-close | Boolean | false | \- | N
1112cancel-btn | String | 取消 | \- | N
1213confirm-btn | String | - | \- | N
1314custom-locale | String | zh | \- | N
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ isComponent: true
6262-- | -- | -- | -- | --
6363style | Object | - | 样式 | N
6464custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
65+ auto-close | Boolean | false | 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible | N
6566cancel-btn | String | 取消 | 取消按钮文字 | N
6667confirm-btn | String | - | 确定按钮文字 | N
6768custom-locale | String | zh | 组件国际化语言,目前支持: 简体中文(zh)、(tc)、英文(en)、日语(ja)、韩语(ko)、俄语(ru)等六种语言 | N
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ exports[`DateTimePicker DateTimePicker year-month-date demo works fine 1`] = `
177177 bind:tap="showPicker"
178178 />
179179 <t-date-time-picker
180+ autoClose = " {{true}}"
180181 defaultValue = " {{1640217600000}}"
181182 end = " 2030-09-09 12:12:12"
182183 filter = " {{[Function]}}"
@@ -192,6 +193,7 @@ exports[`DateTimePicker DateTimePicker year-month-date demo works fine 1`] = `
192193 visible = " {{false}}"
193194 bind:cancel="hidePicker"
194195 bind:change="onConfirm"
196+ bind:close="handleClose"
195197 bind:pick="onColumnChange"
196198 />
197199</year-month-date >
Original file line number Diff line number Diff line change @@ -25,12 +25,11 @@ Page({
2525 [ `${ mode } Visible` ] : true ,
2626 } ) ;
2727 } ,
28- hidePicker ( ) {
29- const { mode } = this . data ;
30- this . setData ( {
31- [ `${ mode } Visible` ] : false ,
32- } ) ;
28+
29+ handleClose ( e ) {
30+ console . log ( 'handleClose:' , e ) ;
3331 } ,
32+
3433 onConfirm ( e ) {
3534 const { value } = e . detail ;
3635 const { mode } = this . data ;
4140 [ mode ] : value ,
4241 [ `${ mode } Text` ] : value ,
4342 } ) ;
44-
45- this . hidePicker ( ) ;
4643 } ,
4744
4845 onColumnChange ( e ) {
Original file line number Diff line number Diff line change 1111
1212<!-- 年月日 -->
1313<t-date-time-picker
14+ auto-close
1415 title="选择日期"
1516 visible="{{dateVisible}}"
1617 mode="date"
17- defaultValue ="{{date}}"
18+ default-value ="{{date}}"
1819 format="YYYY-MM-DD"
1920 start="{{start}}"
2021 end="{{end}}"
2324 bindchange="onConfirm"
2425 bindpick="onColumnChange"
2526 bindcancel="hidePicker"
27+ bindclose="handleClose"
2628/>
Original file line number Diff line number Diff line change 44 class="class {{prefix}}-class {{classPrefix}}"
55 visible="{{visible}}"
66 value="{{columnsValue}}"
7+ header="{{header}}"
8+ title="{{title}}"
9+ auto-close="{{autoClose}}"
10+ confirm-btn="{{confirmBtn || locale.confirm}}"
11+ cancel-btn="{{cancelBtn || locale.cancel}}"
12+ use-popup="{{usePopup}}"
13+ popup-props="{{ popupProps }}"
714 bind:pick="onColumnChange"
815 bind:change="onConfirm"
916 bind:cancel="onCancel"
1017 bind:visible-change="onVisibleChange"
1118 bind:close="onClose"
12- header="{{header}}"
13- title="{{title}}"
14- confirmBtn="{{confirmBtn || locale.confirm}}"
15- cancelBtn="{{cancelBtn || locale.cancel}}"
16- usePopup="{{usePopup}}"
17- popupProps="{{ popupProps }}"
1819>
1920 <slot slot="header" name="header" />
2021 <t-picker-item
Original file line number Diff line number Diff line change 66
77import { TdDateTimePickerProps } from './type' ;
88const props : TdDateTimePickerProps = {
9+ /** 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible */
10+ autoClose : {
11+ type : Boolean ,
12+ value : false ,
13+ } ,
914 /** 取消按钮文字 */
1015 cancelBtn : {
1116 type : String ,
Original file line number Diff line number Diff line change 77import { PopupProps } from '../popup/index' ;
88
99export interface TdDateTimePickerProps {
10+ /**
11+ * 自动关闭;在确认、取消、点击遮罩层自动关闭,不需要手动设置 visible
12+ * @default false
13+ */
14+ autoClose ?: {
15+ type : BooleanConstructor ;
16+ value ?: boolean ;
17+ } ;
1018 /**
1119 * 取消按钮文字
1220 * @default 取消
You can’t perform that action at this time.
0 commit comments