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({
105105 onChangeMode,
106106 mode : initialMode ,
107107 ...( initialValue !== undefined && {
108- content : typeof initialValue === 'string'
109- ? { text : initialValue }
110- : { json : initialValue } ,
108+ content : { [ typeof initialValue === 'string' ? 'text' : 'json' ] : initialValue } ,
111109 } ) ,
112110 } ,
113111 ] ,
@@ -138,9 +136,7 @@ export default defineComponent({
138136 jsonEditor . value . set (
139137 [ undefined , '' ] . includes ( newModelValue )
140138 ? { text : '' }
141- : typeof newModelValue === 'string'
142- ? { text : newModelValue }
143- : { json : newModelValue } ,
139+ : { [ typeof newModelValue === 'string' ? 'text' : 'json' ] : newModelValue } ,
144140 )
145141 }
146142 } ,
You can’t perform that action at this time.
0 commit comments