Skip to content

Commit da72199

Browse files
committed
fix(demo): JsonEditorVue Live Update was broken
1 parent d8e4a43 commit da72199

File tree

4 files changed

+117
-95
lines changed

4 files changed

+117
-95
lines changed

dev/components/demo/PrimeInput.vue

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { ref } from 'vue'
33
import JsonEditorVue from 'json-editor-vue'
44
import { useToast } from 'primevue/usetoast'
55
import type { ToastMessageOptions } from 'primevue/toast'
6-
import { FormKitDataEdit } from 'my-library-components'
6+
import { FormKit, FormKitSchema } from '@formkit/vue'
7+
import FormKitDebug from '../../../src/components/FormKitDebug.vue'
78
89
const props = defineProps<{
910
header: string
@@ -39,10 +40,21 @@ async function submitHandler() {
3940
<slot />
4041
<div class="flex flex-wrap gap-8">
4142
<div class="min-w-30rem basis-1/3 xl:basis-1/4">
42-
<FormKitDataEdit :form-class="formClass" :schema="formSchema" :data="formData" :debug-schema="false" :debug-data="true" @data-saved="submitHandler" />
43+
<div class="p-formkit-data-edit">
44+
<FormKit
45+
id="form"
46+
v-model="formData"
47+
:form-class="formClass"
48+
type="form"
49+
@submit="submitHandler"
50+
>
51+
<FormKitSchema :schema="formSchema" :data="formData" />
52+
</FormKit>
53+
<FormKitDebug :data="formData" header="Data" />
54+
</div>
4355
</div>
4456
<div class="">
45-
<Tabs>
57+
<Tabs value="0">
4658
<TabList>
4759
<Tab value="0">
4860
Supported Attributes
@@ -54,9 +66,6 @@ async function submitHandler() {
5466
Data Editor
5567
</Tab>
5668
</TabList>
57-
<TabPanel header="Schema">
58-
<pre>{{ formSchema }}</pre>
59-
</TabPanel>
6069
<TabPanels>
6170
<TabPanel v-if="primeAttributes || customAttributes" value="0">
6271
<h4>Base Attributes</h4>
@@ -78,10 +87,10 @@ async function submitHandler() {
7887
</div>
7988
</TabPanel>
8089
<TabPanel value="1">
81-
<JsonEditorVue v-model="formSchema" v-bind="{ mode: 'tree' }" class="jse-theme-dark" />
90+
<JsonEditorVue v-model="formSchema" v-bind="{ }" class="jse-theme-dark" />
8291
</TabPanel>
8392
<TabPanel value="2">
84-
<JsonEditorVue v-model="formData" v-bind="{ mode: 'tree' }" class="jse-theme-dark" />
93+
<JsonEditorVue v-model="formData" v-bind="{ }" class="jse-theme-dark" />
8594
</TabPanel>
8695
</TabPanels>
8796
</Tabs>

dev/components/demo/PrimeOutput.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script setup lang='ts'>
22
import { ref } from 'vue'
33
import JsonEditorVue from 'json-editor-vue'
4-
import { FormKitDataView } from 'my-library-components'
4+
import { FormKit, FormKitSchema } from '@formkit/vue'
5+
import FormKitDebug from '../../../src/components/FormKitDebug.vue'
56
67
const props = defineProps<{
78
header: string
@@ -24,10 +25,19 @@ const formData = ref(props.data)
2425
<slot />
2526
<div class="flex flex-wrap gap-8">
2627
<div class="min-w-35rem basis-1/3 md:basis-1/4">
27-
<FormKitDataView :schema="formSchema" :data="formData" :debug-schema="false" :debug-data="true" />
28+
<div class="p-formkit-data-view">
29+
<FormKit
30+
v-model="formData"
31+
type="form"
32+
:actions="false"
33+
>
34+
<FormKitSchema :schema="formSchema" :data="formData" />
35+
</FormKit>
36+
<FormKitDebug :data="formData" header="Data" />
37+
</div>
2838
</div>
2939
<div class="">
30-
<Tabs>
40+
<Tabs value="0">
3141
<TabList>
3242
<Tab value="0">
3343
Supported Attributes
@@ -39,9 +49,6 @@ const formData = ref(props.data)
3949
Data Editor
4050
</Tab>
4151
</TabList>
42-
<TabPanel header="Schema">
43-
<pre>{{ formSchema }}</pre>
44-
</TabPanel>
4552
<TabPanels>
4653
<TabPanel v-if="primeAttributes || customAttributes" value="0">
4754
<h4>Base Attributes</h4>
@@ -60,10 +67,10 @@ const formData = ref(props.data)
6067
</div>
6168
</TabPanel>
6269
<TabPanel value="1">
63-
<JsonEditorVue v-model="formSchema" v-bind="{ mode: 'tree' }" class="jse-theme-dark" />
70+
<JsonEditorVue v-model="formSchema" v-bind="{ }" class="jse-theme-dark" />
6471
</TabPanel>
6572
<TabPanel value="2">
66-
<JsonEditorVue v-model="formData" v-bind="{ mode: 'tree' }" class="jse-theme-dark" />
73+
<JsonEditorVue v-model="formData" v-bind="{ }" class="jse-theme-dark" />
6774
</TabPanel>
6875
</TabPanels>
6976
</Tabs>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@
130130
"unplugin-auto-import": "^0.18.2",
131131
"unplugin-vue-components": "^0.27.3",
132132
"vanilla-jsoneditor": "^0.23.8",
133-
"vite": "^5.3.5",
134-
"vite-plugin-dts": "4.0.0",
133+
"vite": "^5.4.0",
134+
"vite-plugin-dts": "4.0.1",
135135
"vite-plugin-eslint": "^1.8.1",
136136
"vite-plugin-pages": "^0.32.3",
137137
"vite-ssg": "^0.23.8",

0 commit comments

Comments
 (0)