Skip to content

Commit 5c971c0

Browse files
author
Guillaume Chau
committed
CustomValue API: changed 'expandable' to 'closed'
1 parent d1dc299 commit 5c971c0

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/backend/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ export function getCustomInstanceDetails (instance) {
377377
type: 'component',
378378
id: instance.__VUE_DEVTOOLS_UID__,
379379
display: getInstanceName(instance),
380-
expandable: true,
381380
value: reduceStateList(state),
382381
fields: {
383382
abstract: true

src/devtools/components/DataField.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,20 @@ export default {
265265
return typeof this.field.value
266266
},
267267
isExpandableType () {
268-
const value = this.field.value
269-
return (typeof this.fieldOptions.expandable === 'undefined' || this.fieldOptions.expandable) &&
268+
let value = this.field.value
269+
if (this.valueType === 'custom') {
270+
value = value._custom.value
271+
}
272+
const closed = this.fieldOptions.closed
273+
const closedDefined = typeof closed !== 'undefined'
274+
return (!closedDefined &&
270275
(
271276
Array.isArray(value) ||
272-
(this.valueType === 'custom' && value._custom.expandable) ||
273-
(this.valueType !== 'custom' && isPlainObject(value))
277+
isPlainObject(value)
278+
)) ||
279+
(
280+
closedDefined &&
281+
!closed
274282
)
275283
},
276284
isEditable () {

0 commit comments

Comments
 (0)