File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111} from 'vue-demi'
1212import type { PropType } from 'vue-demi'
1313import { JSONEditor } from 'vanilla-jsoneditor'
14+ import type { Content , JSONContent , TextContent } from 'vanilla-jsoneditor'
1415import { conclude } from 'vue-global-config'
1516import { debounce } from 'lodash-es'
1617import { PascalCasedName as name } from '../package.json'
@@ -69,15 +70,15 @@ export default defineComponent({
6970 [ boolAttr , conclude ( [ props [ boolAttr ] , globalProps [ boolAttr ] ] ) ] )
7071 . filter ( ( [ , v ] ) => v !== undefined ) )
7172
72- const onChange = debounce ( ( updatedContent : { text : string ; json : any } ) => {
73+ const onChange = debounce ( ( updatedContent : Content ) => {
7374 if ( preventUpdatingModelValue . value ) {
7475 preventUpdatingModelValue . value = false
7576 return
7677 }
7778 preventUpdatingContent . value = true
78- emit ( updateModelValue , updatedContent . text === undefined
79- ? updatedContent . json
80- : updatedContent . text )
79+ emit ( updateModelValue , ( updatedContent as TextContent ) . text === undefined
80+ ? ( updatedContent as JSONContent ) . json
81+ : ( updatedContent as TextContent ) . text )
8182 } , 100 )
8283
8384 const onChangeMode = ( mode : Mode ) => {
You can’t perform that action at this time.
0 commit comments