添加组件
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
Component({
|
||||
options: { multipleSlots: true },
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
title: null,
|
||||
mode: null,
|
||||
placeholder: null,
|
||||
value: null,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
visible: false,
|
||||
format: {
|
||||
date: 'YYYY-MM-DD',
|
||||
second: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
now: Date.now(),
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
showPicker() {
|
||||
this.setData({ visible: true });
|
||||
},
|
||||
hidePicker() {
|
||||
this.setData({ visible: false });
|
||||
},
|
||||
onConfirm(e: any) {
|
||||
this.triggerEvent('confirm', { value: e.detail.value });
|
||||
this.hidePicker();
|
||||
},
|
||||
onClear() {
|
||||
this.triggerEvent('confirm', { value: '' });
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user