File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 488
488
search: ' ' ,
489
489
open: false ,
490
490
mutableValue: null ,
491
- mutableOptions: [],
492
- mutableLoading: false
491
+ mutableOptions: []
493
492
}
494
493
},
495
494
765
764
* @return {Boolean} True if open
766
765
*/
767
766
dropdownOpen () {
768
- return this .noDrop ? false : this .open
767
+ return this .noDrop ? false : this .open && ! this . mutableLoading
769
768
},
770
769
771
770
/**
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ module.exports = {
27
27
}
28
28
} ,
29
29
30
+ data ( ) {
31
+ return {
32
+ mutableLoading : false
33
+ }
34
+ } ,
35
+
30
36
watch : {
31
37
/**
32
38
* If a callback & search text has been provided,
@@ -38,6 +44,14 @@ module.exports = {
38
44
this . $emit ( 'search' , this . search , this . toggleLoading )
39
45
}
40
46
} ,
47
+ /**
48
+ * Sync the loading prop with the internal
49
+ * mutable loading value.
50
+ * @param val
51
+ */
52
+ loading ( val ) {
53
+ this . mutableLoading = val
54
+ }
41
55
} ,
42
56
43
57
methods : {
Original file line number Diff line number Diff line change @@ -1058,6 +1058,18 @@ describe('Select.vue', () => {
1058
1058
done ( )
1059
1059
} )
1060
1060
} )
1061
+
1062
+ it ( 'will sync mutable loading with the loading prop' , ( done ) => {
1063
+ const vm = new Vue ( {
1064
+ template : '<div><v-select ref="select" :loading="loading"></v-select></div>' ,
1065
+ data : { loading :false }
1066
+ } ) . $mount ( )
1067
+ vm . loading = true
1068
+ Vue . nextTick ( ( ) => {
1069
+ expect ( vm . $refs . select . mutableLoading ) . toEqual ( true )
1070
+ done ( )
1071
+ } )
1072
+ } )
1061
1073
} )
1062
1074
1063
1075
describe ( 'Reset on options change' , ( ) => {
You can’t perform that action at this time.
0 commit comments