feat: PrimeVue 表单
This commit is contained in:
31
src/all-custom/all-custom.vue
Normal file
31
src/all-custom/all-custom.vue
Normal file
@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import Swal from 'sweetalert2';
|
||||
import { form } from '../inputs/form'
|
||||
import { FormKitSummary } from '@formkit/vue'
|
||||
|
||||
async function submit() {
|
||||
await new Promise(r => setTimeout(r, 300))
|
||||
Swal.fire({
|
||||
title: 'Submitted! 🎉',
|
||||
icon: 'success',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<!-- https://formkit.com/inputs/form#props-attributes -->
|
||||
<FormKit
|
||||
:type="form"
|
||||
@submit="submit"
|
||||
submit-label="提交 ✨"
|
||||
:submit-attrs="{ class: 'btn btn-primary' }"
|
||||
:errors="['Our server is not working.', 'But we don’t like you anyway!']"
|
||||
incomplete-message="Please fill out all fields."
|
||||
>
|
||||
<FormKitSummary />
|
||||
<div>content</div>
|
||||
</FormKit>
|
||||
</template>
|
Reference in New Issue
Block a user