Skip to content

Commit 78af116

Browse files
committed
fix(select): 多选不渲染问题
1 parent 4c59853 commit 78af116

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/select/index.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ function ClSelect(props: IProps) {
6060
const value: string = getSelectorValue(index);
6161
setSelected(value);
6262
};
63-
useMemo(() => {
64-
props.mode === 'selector' && setSelected(getSelectorValue(selector.value))
65-
props.mode === 'multiSelector' && setMutiSelected(getMutiSelectorValue(mutiSelector.value))
66-
}, [props.selector])
6763
// 多选
6864
const getMutiSelectorValue = mutiIndex => {
6965
const value: any[] = [];
@@ -173,7 +169,10 @@ function ClSelect(props: IProps) {
173169
}
174170
setTempSelect(tempSelect)
175171
}
176-
172+
useMemo(() => {
173+
props.mode === 'selector' && setSelected(getSelectorValue(selector.value))
174+
props.mode === 'multiSelector' && setMutiSelected(getMutiSelectorValue(mutiSelector.value))
175+
}, [props.selector])
177176
// 单选组件
178177
const selectorComponent = (
179178
<Picker

0 commit comments

Comments
 (0)