File tree Expand file tree Collapse file tree 4 files changed +17
-13
lines changed Expand file tree Collapse file tree 4 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ section.start(:style="gradient")
10
10
a.typo__link ( href ="http://vuejs.org" target ="_BLANK" ) Vue.js
11
11
.badges
12
12
img( src ="https://img.shields.io/github/stars/monterail/vue-multiselect.svg?label=Stars" )
13
- img( src ="https://camo.githubusercontent.com/d0e25b09a82bc4bfde9f1e048a092752eebbb4f3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174 " alt ="License" data-canonical-src ="https://img.shields.io/badge/license-MIT-blue.svg?style=flat" )
14
- img( src ="https://camo.githubusercontent.com/64f9a2333bb303d34b1587e1436b24dee6a8e134/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646d2f7675652d6d756c746973656c6563742e737667 " alt ="npm" data-canonical-src ="https://img.shields.io/npm/dm/vue-multiselect.svg" style ="max-width:100%;" )
15
- img( src ="https://camo.githubusercontent. com/47ff0923e959e736113988e900268dfc7a601d3b/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6f6e74657261696c2f7675652d6d756c746973656c6563742f747265652f6d61737465722e7376673f7374796c653d736869656c6426636972636c652d746f6b656e3d35633933316666323866643132353837363130663833353437326265636464353134643039636566 " alt ="Build Status" data-canonical-src ="https://circleci.com/gh/monterail/vue-multiselect/tree/master.svg?style=shield&circle-token=5c931ff28fd12587610f835472becdd514d09cef" style ="max-width:100%;" )
16
- img( src ="https://camo.githubusercontent.com/51bc9432092f4def26f97d24824c857ad5891c1c/68747470733a2f2f696d672e736869656c64732e696f2f67656d6e617369756d2f6d6f6e74657261696c2f7675652d6d756c746973656c6563742e7376673f7374796c653d666c6174 " alt ="No Dependencies" data-canonical-src ="https://img.shields.io/gemnasium/monterail/vue-multiselect.svg?style=flat" style ="max-width:100%;" )
13
+ img( src ="https://img.shields.io/badge/license-MIT-blue.svg?style=flat " alt ="License" data-canonical-src ="https://img.shields.io/badge/license-MIT-blue.svg?style=flat" )
14
+ img( src ="https://img.shields.io/npm/dm/vue-multiselect.svg " alt ="npm" data-canonical-src ="https://img.shields.io/npm/dm/vue-multiselect.svg" style ="max-width:100%;" )
15
+ img( src ="https://circleci. com/gh/monterail/vue-multiselect/tree/2.0.svg?style=shield&circle-token=5c931ff28fd12587610f835472becdd514d09cef " alt ="Build Status" data-canonical-src ="https://circleci.com/gh/monterail/vue-multiselect/tree/master.svg?style=shield&circle-token=5c931ff28fd12587610f835472becdd514d09cef" style ="max-width:100%;" )
16
+ img( src ="https://img.shields.io/gemnasium/monterail/vue-multiselect.svg?style=flat " alt ="No Dependencies" data-canonical-src ="https://img.shields.io/gemnasium/monterail/vue-multiselect.svg?style=flat" style ="max-width:100%;" )
17
17
.grid__row.grid__row--centered
18
18
.grid__column.grid__unit--md-6
19
19
.multiselect-example__container
Original file line number Diff line number Diff line change 9
9
placeholder ="Select one" ,
10
10
:options ="options" ,
11
11
:searchable ="false" ,
12
- :allow-empty ="true "
12
+ :allow-empty ="false "
13
13
)
14
14
pre.language-json
15
15
code.
Original file line number Diff line number Diff line change 53
53
<span
54
54
v-if =" !searchable"
55
55
class =" multiselect__single"
56
- @mousedown.prevent =" toggle() "
56
+ @mousedown.prevent =" toggle"
57
57
v-text =" currentOptionLabel" >
58
58
</span >
59
59
</div >
60
60
<transition name =" multiselect" >
61
61
<div
62
62
class =" multiselect__content-wrapper"
63
63
v-show =" isOpen"
64
- @focus =" activate() "
64
+ @focus =" activate"
65
65
@mousedown.prevent
66
66
:style =" { maxHeight: optimizedHeight + 'px' }"
67
67
ref =" list" >
Original file line number Diff line number Diff line change @@ -221,12 +221,13 @@ export default {
221
221
default : 'Press enter to create a tag'
222
222
} ,
223
223
/**
224
- * Number of allowed selected options. No limit if false .
225
- * @default False
224
+ * Number of allowed selected options. No limit if 0 .
225
+ * @default 0
226
226
* @type {Number }
227
227
*/
228
228
max : {
229
- type : Number
229
+ type : [ Number , Boolean ] ,
230
+ default : false
230
231
} ,
231
232
/**
232
233
* Will be passed with all events as second param.
@@ -287,6 +288,9 @@ export default {
287
288
if ( ! this . multiple && ! this . clearOnSelect ) {
288
289
console . warn ( '[Vue-Multiselect warn]: ClearOnSelect and Multiple props can’t be both set to false.' )
289
290
}
291
+ if ( ! this . multiple && this . max ) {
292
+ console . warn ( '[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.' )
293
+ }
290
294
} ,
291
295
computed : {
292
296
filteredOptions ( ) {
@@ -335,17 +339,17 @@ export default {
335
339
}
336
340
} ,
337
341
watch : {
338
- [ ' internalValue' ] ( newVal , oldVal ) {
342
+ internalValue ( newVal , oldVal ) {
339
343
/* istanbul ignore else */
340
344
if ( this . resetAfter && this . internalValue . length ) {
341
345
this . search = ''
342
346
this . internalValue = [ ]
343
347
}
344
348
} ,
345
- [ ' search' ] ( ) {
349
+ search ( ) {
346
350
this . $emit ( 'search-change' , this . search , this . id )
347
351
} ,
348
- [ ' value' ] ( value ) {
352
+ value ( value ) {
349
353
this . internalValue = this . getInternalValue ( value )
350
354
}
351
355
} ,
You can’t perform that action at this time.
0 commit comments