【功能完善】IoT: 场景联动执行器 array、struct 类型数据编辑

This commit is contained in:
puhui999
2025-03-29 23:02:56 +08:00
parent f46540759f
commit 1bc2978bc6
3 changed files with 110 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ import { JsonEditorEmits, JsonEditorExpose, JsonEditorProps } from '../types'
defineOptions({ name: 'JsonEditor' })
const props = withDefaults(defineProps<JsonEditorProps>(), {
mode: 'tree' as JSONEditorMode,
mode: 'view' as JSONEditorMode,
height: '400px',
showModeSelection: false,
showNavigationBar: false,
@@ -58,6 +58,10 @@ const initJsonEditor = () => {
if (jsonObj.value) {
jsonEditor.set(jsonObj.value)
}
if (props.mode === 'view') {
jsonEditor?.expandAll() // 默认展开全部
}
}
// 监听数据变化