8000 fix: JSON editor · romhml/compodium@2588c70 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 2588c70

Browse files
committed
fix: JSON editor
1 parent f4a483a commit 2588c70<
8000
/span>

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

devtools/app/components/JsonEditor.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { Mode } from 'vanilla-jsoneditor'
55
const modelValue = defineModel<Record<string, any>>({ default: () => {} })
66
77
const jsonValue = shallowRef(modelValue.value)
8-
98
watch(jsonValue, (value) => {
10-
if (value) modelValue.value = value
9+
if (value && typeof value === 'object') {
10+
modelValue.value = value
11+
}
1112
})
1213
</script>
1314

devtools/app/pages/components/[id].vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ async function updateComponent() {
125125
await hooks.callHook('renderer:update-combo', { props: comboProps.value?.filter(Boolean) as ComboItem[] ?? [] })
126126
}
127127
128-
const updatePropsDebounced = useDebounceFn(() => hooks.callHook('renderer:update-props', { props: props.value }), 100, { maxWait: 300 })
128+
const updatePropsDebounced = useDebounceFn(() => {
129+
hooks.callHook('renderer:update-props', { props: { ...props.value } }),
130+
100, { maxWait: 300 }
131+
})
129132
130133
const hooks = createHooks<CompodiumHooks>()
131134

0 commit comments

Comments
 (0)
0