feat: 在 all-custom 组件中添加 group 类型支持并更新按钮功能
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { FormKitNode } from '@formkit/core';
|
import { FormKitNode } from '@formkit/core';
|
||||||
import { text } from '@formkit/inputs';
|
import { text, group } from '@formkit/inputs';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
|
|
||||||
async function submit(formData: Record<string, any>, formNode: FormKitNode) {
|
async function submit(formData: Record<string, any>, formNode: FormKitNode) {
|
||||||
@ -78,13 +78,6 @@ async function submit(formData: Record<string, any>, formNode: FormKitNode) {
|
|||||||
</template> -->
|
</template> -->
|
||||||
</FormKit>
|
</FormKit>
|
||||||
|
|
||||||
<Button
|
|
||||||
label="Button"
|
|
||||||
@click="() => {
|
|
||||||
value!.button = value!.button || {};
|
|
||||||
(value!.button as any).clicked = 'clicked';
|
|
||||||
}"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormKit
|
<FormKit
|
||||||
type="group"
|
type="group"
|
||||||
@ -108,6 +101,15 @@ async function submit(formData: Record<string, any>, formNode: FormKitNode) {
|
|||||||
</FormKit>
|
</FormKit>
|
||||||
</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
|
<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>
|
">{{ value }}</pre>
|
||||||
<!-- <FormKitSummary /> -->
|
<!-- <FormKitSummary /> -->
|
||||||
|
Reference in New Issue
Block a user