From 0f70eeca7320a150a4d6237612523c15f9889c32 Mon Sep 17 00:00:00 2001 From: Reg1350 <36145541+Reg1350@users.noreply.github.com> Date: Wed, 12 Oct 2022 17:18:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(tree):=20watch=E8=81=94=E5=8A=A8=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=89=BE=E4=B8=8D=E5=88=B0=E7=88=B6=E8=8A=82=E7=82=B9?= =?UTF-8?q?=20(#1754)=20(#1848)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Chenfs --- .../__snapshots__/index.test.jsx.snap | 1156 ----------------- .../__snapshots__/index.test.jsx.snap | 411 ------ src/tree/useTree.tsx | 3 + 3 files changed, 3 insertions(+), 1567 deletions(-) delete mode 100644 src/input-number/__tests__/__snapshots__/index.test.jsx.snap delete mode 100644 src/message/__tests__/__snapshots__/index.test.jsx.snap diff --git a/src/input-number/__tests__/__snapshots__/index.test.jsx.snap b/src/input-number/__tests__/__snapshots__/index.test.jsx.snap deleted file mode 100644 index d77c28f9ea..0000000000 --- a/src/input-number/__tests__/__snapshots__/index.test.jsx.snap +++ /dev/null @@ -1,1156 +0,0 @@ -// Vitest Snapshot v1 - -exports[`InputNumber > :props > :defaultValue, default value 6 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :disabled, function can not be call 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :format, with 6% 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :max, value 6 < max 10 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :max, value 16 > max 10 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :min, value -1 < min 1 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :min, value 6 > min 1 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :mode, without class t-is-controls-right 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :mode:column, with class t-is-controls-right 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :mode:row, without class t-is-controls-right 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :size:large, with class t-size-l 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :size:medium, with class t-size-m 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :size:small, with class t-size-s 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :step, 2 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > :value, 6 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; - -exports[`InputNumber > :props > class, with class t-input-number 1`] = ` -
- -
-
- - - - - - - -
- -
- - -
-`; diff --git a/src/message/__tests__/__snapshots__/index.test.jsx.snap b/src/message/__tests__/__snapshots__/index.test.jsx.snap deleted file mode 100644 index 94106551f5..0000000000 --- a/src/message/__tests__/__snapshots__/index.test.jsx.snap +++ /dev/null @@ -1,411 +0,0 @@ -// Vitest Snapshot v1 - -exports[`Message > :props > :closeBtn is a function, () => VNode. 1`] = ` -
- - - - - - - x - - -
-`; - -exports[`Message > :props > :closeBtn is a string, equal "关闭". 1`] = ` -
- - - - - - 关闭 - -
-`; - -exports[`Message > :props > :closeBtn is true, render default close button. 1`] = ` -
- - - - - - - - - -
-`; - -exports[`Message > :props > :default is a function, () => 这是重要信息 1`] = ` -
- - - - - 这是重要信息 - - - - -
-`; - -exports[`Message > :props > :default is a string, 这是普通信息 1`] = ` -
- - - - 这是普通信息 - - - -
-`; - -exports[`Message > :props > :icon is a function, () => MoreIcon 1`] = ` -
- - - - - - - -
-`; - -exports[`Message > :props > :icon is false 1`] = ` -
- - - - - -
-`; - -exports[`Message > :props > :theme info,success,warning,error,question,loading 1`] = ` -
- - - - - - - -
-`; - -exports[`Message > :props > :theme info,success,warning,error,question,loading 2`] = ` -
- - - - - - - -
-`; - -exports[`Message > :props > :theme info,success,warning,error,question,loading 3`] = ` -
- - - - - - - -
-`; - -exports[`Message > :props > :theme info,success,warning,error,question,loading 4`] = ` -
- - - - - - - -
-`; - -exports[`Message > :props > :theme info,success,warning,error,question,loading 5`] = ` -
- - - - - - - -
-`; - -exports[`Message > :props > :theme info,success,warning,error,question,loading 6`] = ` -
-
- - -
- - - -
- - - - - -`; - -exports[`Message > :props > pure message contains two classes 1`] = ` -
- - - - - - - -
-`; - -exports[`Message > > 1`] = ` -
- - - - - - - - - -
-`; diff --git a/src/tree/useTree.tsx b/src/tree/useTree.tsx index 5a49d84a6e..8ec08cbbb3 100644 --- a/src/tree/useTree.tsx +++ b/src/tree/useTree.tsx @@ -218,6 +218,9 @@ export default function useTree(props: TdTreeProps) { cacheMap.clear(); treeStore.value.reload(list); + // 刷新节点,必须在配置选中之前执行 + // 这样选中态联动判断才能找到父节点 + treeStore.value.refreshNodes(); if (!list.length) return; // 初始化选中状态 if (Array.isArray(innerChecked.value)) {