@@ -3,17 +3,7 @@ import { globalAttrs, globalProps } from './install'
3
3
import { debounce } from 'lodash-es'
4
4
import { JSONEditor } from 'vanilla-jsoneditor'
5
5
import type { Content , JSONContent , TextContent } from 'vanilla-jsoneditor'
6
- import {
7
- defineComponent ,
8
- getCurrentInstance ,
9
- h ,
10
- isVue3 ,
11
- onMounted ,
12
- onUnmounted ,
13
- ref ,
14
- unref ,
15
- watch ,
16
- } from 'vue-demi'
6
+ import { defineComponent , getCurrentInstance , h , isVue3 , onMounted , onUnmounted , ref , unref , watch } from 'vue-demi'
17
7
import type { PropType } from 'vue-demi'
18
8
import { conclude } from 'vue-global-config'
19
9
@@ -74,15 +64,11 @@ export default defineComponent({
74
64
const initialMode = conclude ( [ props . mode , globalProps . mode ] , {
75
65
type : String as PropType < Mode > ,
76
66
} )
77
- const initialValue = conclude ( [
78
- props [ modelValueProp ] ,
79
- globalProps [ modelValueProp ] ,
80
- ] )
67
+ const initialValue = conclude ( [ props [ modelValueProp ] , globalProps [ modelValueProp ] ] )
81
68
const initialBoolAttrs = Object . fromEntries (
82
- Array . from ( boolAttrs , ( boolAttr ) => [
83
- boolAttr ,
84
- conclude ( [ props [ boolAttr ] , globalProps [ boolAttr ] ] ) ,
85
- ] ) . filter ( ( [ , v ] ) => v !== undefined ) ,
69
+ Array . from ( boolAttrs , ( boolAttr ) => [ boolAttr , conclude ( [ props [ boolAttr ] , globalProps [ boolAttr ] ] ) ] ) . filter (
70
+ ( [ , v ] ) => v !== undefined ,
71
+ ) ,
86
72
)
87
73
88
74
const onChange = debounce ( ( updatedContent : Content ) => {
@@ -103,11 +89,10 @@ export default defineComponent({
103
89
emit ( 'update:mode' , mode )
104
90
}
105
91
106
- const mergeFunction =
107
- ( previousValue : Function , currentValue : Function ) => ( ...args : any ) => {
108
- previousValue ( ...args )
109
- currentValue ( ...args )
110
- }
92
+ const mergeFunction = ( previousValue : Function , currentValue : Function ) => ( ...args : any ) => {
93
+ previousValue ( ...args )
94
+ currentValue ( ...args )
95
+ }
111
96
112
97
const initialAttrs = conclude (
113
98
[
@@ -168,11 +153,7 @@ export default defineComponent({
168
153
( ) => Array . from ( boolAttrs , ( boolAttr ) => props [ boolAttr ] ) ,
169
154
( values ) => {
170
155
jsonEditor . value . updateProps (
171
- Object . fromEntries (
172
- Array . from ( values , ( v , i ) => [ boolAttrs [ i ] , v ] ) . filter (
173
- ( [ , v ] ) => v !== undefined ,
174
- ) ,
175
- ) ,
156
+ Object . fromEntries ( Array . from ( values , ( v , i ) => [ boolAttrs [ i ] , v ] ) . filter ( ( [ , v ] ) => v !== undefined ) ) ,
176
157
)
177
158
} ,
178
159
)
0 commit comments