File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/common/component Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,22 @@ const emit = defineEmits(['selectAll'])
27
27
28
28
const filterList = computed (() => props .allItems .filter ((item ) => props .selected .some ((i ) => item .id === i .id )))
29
29
30
+ const selectNotSearchList = computed (() =>
31
+ props .selected .filter ((item ) => ! props .allItems .some ((i ) => item .id === i .id ))
32
+ )
33
+
30
34
const selectedAll = computed ({
31
35
get() {
32
36
return props .allItems .length > 0 && props .allItems .length === filterList .value .length
33
37
},
34
38
set(value ) {
35
39
if (value ) {
36
- emit (' selectAll' , props .allItems )
40
+ emit (' selectAll' , props .allItems . concat ( selectNotSearchList . value ) )
37
41
} else {
42
+ if (selectNotSearchList .value .length ) {
43
+ emit (' selectAll' , selectNotSearchList .value )
44
+ return
45
+ }
38
46
emit (' selectAll' , null )
39
47
}
40
48
}
You can’t perform that action at this time.
0 commit comments