File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,7 @@ export default defineComponent({
105
105
onChangeMode,
106
106
mode : initialMode ,
107
107
...( initialValue !== undefined && {
108
- content : typeof initialValue === 'string'
109
- ? { text : initialValue }
110
- : { json : initialValue } ,
108
+ content : { [ typeof initialValue === 'string' ? 'text' : 'json' ] : initialValue } ,
111
109
} ) ,
112
110
} ,
113
111
] ,
@@ -138,9 +136,7 @@ export default defineComponent({
138
136
jsonEditor . value . set (
139
137
[ undefined , '' ] . includes ( newModelValue )
140
138
? { text : '' }
141
- : typeof newModelValue === 'string'
142
- ? { text : newModelValue }
143
- : { json : newModelValue } ,
139
+ : { [ typeof newModelValue === 'string' ? 'text' : 'json' ] : newModelValue } ,
144
140
)
145
141
}
146
142
} ,
You can’t perform that action at this time.
0 commit comments