From 31e4380d96344331c8ea9c0f64496c8ceb799e21 Mon Sep 17 00:00:00 2001 From: luffyzhao Date: Fri, 25 May 2018 14:01:53 +0800 Subject: [PATCH] 还是要保留multiple判断 --- src/components/select/select.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index ed573b3..ce4a186 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -408,10 +408,11 @@ }; }, getInitialValue(){ - const {value} = this; + const {multiple, value} = this; let initialValue = Array.isArray(value) ? value : [value]; + if (!multiple && (typeof initialValue[0] === 'undefined' || (String(initialValue[0]).trim() === '' && !Number.isFinite(initialValue[0])))) initialValue = []; return initialValue.filter((item) => { - return Boolean(item) || item === 0; + return Boolean(item) || item === 0 }); }, processOption(option, values, isFocused){ -- libgit2 0.21.4