feat: 添加 PDatePicker 组件
Some checks failed
/ test (push) Successful in 22s
/ surge (push) Failing after 2m22s

This commit is contained in:
严浩
2024-12-23 16:57:02 +08:00
parent c1c8e470fd
commit 70a9aa5b79
8 changed files with 995 additions and 576 deletions

View File

@ -2,6 +2,7 @@
import { FormKitNode } from '@formkit/core';
import { text } from '@formkit/inputs';
import Swal from 'sweetalert2';
import dayjs from 'dayjs';
async function submit(formData: Record<string, any>, formNode: FormKitNode) {
console.group('submit');
@ -98,6 +99,18 @@ const promiseOptions = new Promise<typeof K_OPTIONS>(resolve => {
optionLabel="label"
optionValue="value"
/>
<FormKit
type="PDatePicker"
name="PDatePicker"
:manualInput="false"
dateFormat="yy年mm月"
:dateToValue="(date) => dayjs(date as Date).format('YYYY-MM')"
:valueToDate="(value) => dayjs(value as string).toDate()"
view="month"
value="2022-01"
label="选日期"
validation="required"
/>
<div class="flex flex-wrap gap-4">
<FormKit