@@ -30,15 +30,15 @@ const formData = reactive(props.data)
3030const data = ref ({})
3131
3232async function submitHandler() {
33- showMessage (' success' , ' Form Submitted ' , ' Input creation completed successfully ...' )
33+ showMessage (' success' , ` Form Input (${ formData . _dollar_formkit }) updated ` , ' Input creation completed successfully ...' )
3434
3535 data .value = { }
3636 schemaResultFormKey .value += 1
3737 Object .assign (formData , { ... formData , schemaResultFormKey: schemaResultFormKey .value })
3838}
3939
4040async function submitHandler2() {
41-
41+ showMessage ( ' success ' , ` Data submitted ` , data . value )
4242}
4343
4444const schemaResult = computed (() => editorDataToSchema (formData ))
@@ -61,8 +61,8 @@ function copyObject() {
6161 {{ header }}
6262 </h2 >
6363 <slot />
64- <div class =" flex flex-wrap gap-8" >
65- <div class =" min- w-40rem basis-1/2 md:basis-1/3" >
64+ <div class =" grid grid-cols-1 xl:grid-cols-2 gap-8" >
65+ <div class =" w-40rem basis-1/2 md:basis-1/3" mb-4 >
6666 <h3 >Create Formkit Input</h3 >
6767 <FormKit
6868 v-model =" formData"
@@ -77,28 +77,29 @@ function copyObject() {
7777 </FormKit >
7878 <pre v-if =" false" >{{ formSchema }}</pre >
7979 </div >
80- <div class = " " >
80+ <div >
8181 <h3 >Generated Formkit Input Preview</h3 >
8282 <div class =" mb-4" >
8383 Some changes require to trigger the update of generated input
8484 </div >
8585 <div :key =" schemaResultFormKey" >
86- <FormKit
87- v-model =" data"
88- type =" form"
89- :submit-attrs =" {
90- inputClass: 'p-button p-component',
91- }"
92- @submit =" submitHandler2"
93- >
94- <FormKitSchema :schema =" schemaResult" :data =" data" />
95- </FormKit >
96- <div class =" mt-4 mb-4" >
97- <h3 >Copy Schema to Clipboard - Supported: {{ isSupported }}</h3 >
98- <Button label =" Copy as JSON" class =" mr-4" @click =" copyJson" /><Button label =" Copy as Object" @click =" copyObject" />
86+ <div class =" max-w-100" >
87+ <FormKit
88+ v-model =" data"
89+ type =" form"
90+ :submit-attrs =" {
91+ inputClass: 'p-button p-component',
92+ }"
93+ @submit =" submitHandler2"
94+ >
95+ <FormKitSchema :schema =" schemaResult" :data =" data" />
96+ </FormKit >
9997 </div >
10098 <h3 >Generated Formkit Schema</h3 >
10199 <pre >{{ schemaResult }}</pre >
100+ <Button v-if =" isSupported" label =" Copy as JSON" class =" mr-4" @click =" copyJson" />
101+ <Button v-if =" isSupported" label =" Copy as Object" @click =" copyObject" />
102+
102103 <h3 >Generated Formkit Data</h3 >
103104 <pre >{{ data }}</pre >
104105 </div >
0 commit comments