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 {
11
11
} from 'vue-demi'
12
12
import type { PropType } from 'vue-demi'
13
13
import { JSONEditor } from 'vanilla-jsoneditor'
14
+ import type { Content , JSONContent , TextContent } from 'vanilla-jsoneditor'
14
15
import { conclude } from 'vue-global-config'
15
16
import { debounce } from 'lodash-es'
16
17
import { PascalCasedName as name } from '../package.json'
@@ -69,15 +70,15 @@ export default defineComponent({
69
70
[ boolAttr , conclude ( [ props [ boolAttr ] , globalProps [ boolAttr ] ] ) ] )
70
71
. filter ( ( [ , v ] ) => v !== undefined ) )
71
72
72
- const onChange = debounce ( ( updatedContent : { text : string ; json : any } ) => {
73
+ const onChange = debounce ( ( updatedContent : Content ) => {
73
74
if ( preventUpdatingModelValue . value ) {
74
75
preventUpdatingModelValue . value = false
75
76
return
76
77
}
77
78
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 )
81
82
} , 100 )
82
83
83
84
const onChangeMode = ( mode : Mode ) => {
You can’t perform that action at this time.
0 commit comments