Files
FreeERP.Applet/miniprogram/pages/components/date-picker-plugin/date-picker-plugin.ts

44 lines
747 B
TypeScript
Raw Normal View History

2026-01-28 16:00:56 +08:00
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: '' });
},
},
});