From 7f72a1b86fa16282b850493fdf683f3932909705 Mon Sep 17 00:00:00 2001 From: zhangming Date: Fri, 13 Sep 2024 10:38:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(cascader):=20=E5=8F=97=E6=8E=A7=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=8B=20value=20=E5=8F=98=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=BB=84=E4=BB=B6=E9=80=89=E4=B8=AD=E7=8A=B6?= =?UTF-8?q?=E6=80=81=20(#2591)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/cascader/cascader.taro.tsx | 4 ++++ src/packages/cascader/cascader.tsx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/packages/cascader/cascader.taro.tsx b/src/packages/cascader/cascader.taro.tsx index aaecbf8151..51e5541966 100644 --- a/src/packages/cascader/cascader.taro.tsx +++ b/src/packages/cascader/cascader.taro.tsx @@ -171,6 +171,10 @@ const InternalCascader: ForwardRefRenderFunction< initData() }, [options, format]) + useEffect(() => { + syncValue() + }, [value]) + const initData = async () => { // 初始化开始处理数据 state.lazyLoadMap.clear() diff --git a/src/packages/cascader/cascader.tsx b/src/packages/cascader/cascader.tsx index a9c84f5195..79d03f9d25 100644 --- a/src/packages/cascader/cascader.tsx +++ b/src/packages/cascader/cascader.tsx @@ -170,6 +170,10 @@ const InternalCascader: ForwardRefRenderFunction< initData() }, [options, format]) + useEffect(() => { + syncValue() + }, [value]) + const initData = async () => { // 初始化开始处理数据 state.lazyLoadMap.clear()