feat: 在 all-custom 组件中添加 group 类型支持并更新按钮功能
Some checks failed
/ test (push) Failing after 27s
/ surge (push) Successful in 37s

This commit is contained in:
严浩
2024-12-04 16:31:33 +08:00
parent dc6b45285d
commit 0afb696583

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import { FormKitNode } from '@formkit/core';
import { text } from '@formkit/inputs';
import { text, group } from '@formkit/inputs';
import Swal from 'sweetalert2';
async function submit(formData: Record<string, any>, formNode: FormKitNode) {
@ -78,13 +78,6 @@ async function submit(formData: Record<string, any>, formNode: FormKitNode) {
</template> -->
</FormKit>
<Button
label="Button"
@click="() => {
value!.button = value!.button || {};
(value!.button as any).clicked = 'clicked';
}"
/>
<FormKit
type="group"
@ -108,6 +101,15 @@ async function submit(formData: Record<string, any>, formNode: FormKitNode) {
</FormKit>
</FormKit>
<Button
label="Button"
@click="() => {
value!.button = value!.button || {};
(value!.button as any).clicked = 'clicked';
(value!.group as any)['text-in-group-1'] = 'changed-by-button';
}"
/>
<pre class="font-mono text-sm p-4 bg-slate-100 dark:bg-gray-900 overflow-x-auto rounded-md shadow-inner dark:text-gray-300
">{{ value }}</pre>
<!-- <FormKitSummary /> -->