添加组件

This commit is contained in:
zhengw
2026-01-28 16:00:56 +08:00
parent 7ff1a911dd
commit 193856ccdb
15 changed files with 259 additions and 13 deletions

View File

@@ -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: '' });
},
},
});