Commit 31e4380d96344331c8ea9c0f64496c8ceb799e21
1 parent
583e23a4
还是要保留multiple判断
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
src/components/select/select.vue
... | ... | @@ -408,10 +408,11 @@ |
408 | 408 | }; |
409 | 409 | }, |
410 | 410 | getInitialValue(){ |
411 | - const {value} = this; | |
411 | + const {multiple, value} = this; | |
412 | 412 | let initialValue = Array.isArray(value) ? value : [value]; |
413 | + if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; | |
413 | 414 | return initialValue.filter((item) => { |
414 | - return Boolean(item) || item === 0; | |
415 | + return Boolean(item) || item === 0 | |
415 | 416 | }); |
416 | 417 | }, |
417 | 418 | processOption(option, values, isFocused){ | ... | ... |