diff --git a/src/components/common/code-mirror.vue b/src/components/common/code-mirror.vue index a20946d..1aa6d9d 100644 --- a/src/components/common/code-mirror.vue +++ b/src/components/common/code-mirror.vue @@ -11,7 +11,7 @@ defineOptions({ }); interface Props { - modelValue: string; + modelValue?: string; lang?: NaiveUI.CodeMirrorLang; height?: string; fontSize?: string; @@ -25,7 +25,8 @@ const props = withDefaults(defineProps(), { readonly: false, disabled: false, height: 'auto', - fontSize: '13px' + fontSize: '13px', + modelValue: '' }); interface Emits { diff --git a/src/components/common/dynamic-input.vue b/src/components/common/dynamic-input.vue index 6ad3cde..06560ef 100644 --- a/src/components/common/dynamic-input.vue +++ b/src/components/common/dynamic-input.vue @@ -51,6 +51,20 @@ const boolenOptions = [ value: 1 } ]; + +const handleUpdateType = (index: number) => { + if (content.value[index].type === 'string') { + content.value[index].value = ''; + } + + if (content.value[index].type === 'boolean') { + content.value[index].value = 1; + } + + if (content.value[index].type === 'number') { + content.value[index].value = 0; + } +};