feat: 添加 PDatePicker 组件
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user