File tree Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Expand file tree Collapse file tree 3 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 8
8
:close-on-select ="false" ,
9
9
:clear-on-select ="false" ,
10
10
:hide-selected ="true" ,
11
+ :preserve-search ="true" ,
11
12
placeholder ="Pick some"
12
13
label ="name" ,
13
14
track-by ="name"
14
15
)
16
+ template( slot ="tag" , scope ="props" )
17
+ span.custom__tag
18
+ span {{ props.option.language }}
19
+ span.custom__remove ( @click ="props.remove(props.option)" ) ❌
15
20
pre.language-json
16
21
code.
17
22
{{ value }}
@@ -43,5 +48,13 @@ export default {
43
48
}
44
49
</script >
45
50
46
- <style lang="css">
51
+ <style lang="sass">
52
+ .custom__tag
53
+ display : inline-block
54
+ padding : 2px 6px
55
+ background : #ddd
56
+ margin-right : 4px
57
+
58
+ .custom__remove
59
+ padding : 3px
47
60
</style >
Original file line number Diff line number Diff line change 93
93
"sinon" : " ^1.17.3" ,
94
94
"sinon-chai" : " ^2.8.0" ,
95
95
"url-loader" : " ^0.5.7" ,
96
- "vue" : " 2.1.10 " ,
96
+ "vue" : " ^2.3.0 " ,
97
97
"vue-hot-reload-api" : " ^1.2.0" ,
98
98
"vue-html-loader" : " ^1.0.0" ,
99
99
"vue-loader" : " ^11.0.0" ,
100
100
"vue-style-loader" : " ^2.0.0" ,
101
- "vue-template-compiler" : " 2.1.10 " ,
101
+ "vue-template-compiler" : " ^2.3.4 " ,
102
102
"vue-template-es2015-compiler" : " ^1.4.2" ,
103
103
"vuex" : " ^2.1.1" ,
104
104
"webpack" : " ^2.2.1" ,
Original file line number Diff line number Diff line change @@ -265,6 +265,10 @@ export default {
265
265
default ( ) {
266
266
return [ ]
267
267
}
268
+ } ,
269
+ preserveSearch : {
270
+ type : Boolean ,
271
+ default : false
268
272
}
269
273
} ,
270
274
mounted ( ) {
@@ -527,7 +531,7 @@ export default {
527
531
this . isOpen = true
528
532
/* istanbul ignore else */
529
533
if ( this . searchable ) {
530
- this . search = ''
534
+ if ( ! this . preserveSearch ) this . search = ''
531
535
this . $nextTick ( ( ) => this . $refs . search . focus ( ) )
532
536
} else {
533
537
this . $el . focus ( )
@@ -549,7 +553,7 @@ export default {
549
553
} else {
550
554
this . $el . blur ( )
551
555
}
552
- this . search = ''
556
+ if ( ! this . preserveSearch ) this . search = ''
553
557
this . $emit ( 'close' , this . getValue ( ) , this . id )
554
558
} ,
555
559
/**
You can’t perform that action at this time.
0 commit comments