@@ -11,7 +11,8 @@ import {
11
11
ref ,
12
12
shallowRef ,
13
13
toRaw ,
14
- toRef , toValue ,
14
+ toRef ,
15
+ toValue ,
15
16
} from 'vue'
16
17
import {
17
18
independentActiveStrategy ,
@@ -136,8 +137,8 @@ export const useNested = (props: NestedProps) => {
136
137
props ,
137
138
'opened' ,
138
139
props . opened ,
139
- v => new Set ( toRaw ( v ) ) ,
140
- v => [ ...toRaw ( v ) . values ( ) ] ,
140
+ v => new Set ( Array . isArray ( v ) ? v . map ( i => toRaw ( i ) ) : v ) ,
141
+ v => [ ...v . values ( ) ] ,
141
142
)
142
143
143
144
const activeStrategy = computed ( ( ) => {
@@ -360,10 +361,10 @@ export const useNestedItem = (id: MaybeRefOrGetter<unknown>, isGroup: boolean) =
360
361
isOpen : computed ( ( ) => parent . root . opened . value . has ( computedId . value ) ) ,
361
362
parent : computed ( ( ) => parent . root . parents . value . get ( computedId . value ) ) ,
362
363
activate : ( activated : boolean , e ?: Event ) => parent . root . activate ( computedId . value , activated , e ) ,
363
- isActivated : computed ( ( ) => parent . root . activated . value . has ( toRaw ( computedId . value ) ) ) ,
364
+ isActivated : computed ( ( ) => parent . root . activated . value . has ( computedId . value ) ) ,
364
365
select : ( selected : boolean , e ?: Event ) => parent . root . select ( computedId . value , selected , e ) ,
365
- isSelected : computed ( ( ) => parent . root . selected . value . get ( toRaw ( computedId . value ) ) === 'on' ) ,
366
- isIndeterminate : computed ( ( ) => parent . root . selected . value . get ( toRaw ( computedId . value ) ) === 'indeterminate' ) ,
366
+ isSelected : computed ( ( ) => parent . root . selected . value . get ( computedId . value ) === 'on' ) ,
367
+ isIndeterminate : computed ( ( ) => parent . root . selected . value . get ( computedId . value ) === 'indeterminate' ) ,
367
368
isLeaf : computed ( ( ) => ! parent . root . children . value . get ( computedId . value ) ) ,
368
369
isGroupActivator : parent . isGroupActivator ,
369
370
}
0 commit comments