From b4138675d4ffd8aa2c95c387f87a688ad21ee553 Mon Sep 17 00:00:00 2001 From: luffyzhao Date: Fri, 25 May 2018 11:37:15 +0800 Subject: [PATCH] select-binding-0 --- src/components/select/select.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 89d8e65..a19dfb8 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -410,8 +410,10 @@ getInitialValue(){ const {multiple, value} = this; let initialValue = Array.isArray(value) ? value : [value]; - if (!multiple && (typeof initialValue[0] === 'undefined' || String(initialValue[0]).trim() === '')) initialValue = []; - return initialValue.filter(Boolean); + if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isfinite(initialValue[0])) )) initialValue = []; + return initialValue.filter((item) => { + return Boolean(item) || item === 0 + }); }, processOption(option, values, isFocused){ if (!option.componentOptions) return option; -- libgit2 0.21.4