From 8e07b42789589ebc82140e09fcd938f685376f83 Mon Sep 17 00:00:00 2001 From: shixiaohua Date: Tue, 6 Feb 2024 16:03:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=A4=84=E7=90=86=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ItemTree/index.jsx | 2 +- src/redux/tableBarItem_reducer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ItemTree/index.jsx b/src/components/ItemTree/index.jsx index 9b37b67..549ac87 100644 --- a/src/components/ItemTree/index.jsx +++ b/src/components/ItemTree/index.jsx @@ -190,7 +190,7 @@ const ItemTree = (prop) => { } else { // 打开文件 dispatch(addTableBarItem({ - label: e.node.title, + label: e.node.title.props.children[0], children: e.node.key, key: e.node.key, activeKey: e.node.key diff --git a/src/redux/tableBarItem_reducer.js b/src/redux/tableBarItem_reducer.js index 99b55be..592771b 100644 --- a/src/redux/tableBarItem_reducer.js +++ b/src/redux/tableBarItem_reducer.js @@ -18,9 +18,9 @@ export const tableBarItemSlice = createSlice({ }, reducers: { addTableBarItem: (state, action) => { - console.log("tableBarItemSlice:tableBarItem", state, action,) + console.log("tableBarItemSlice:addTableBarItem", state, action) if (state.data.filter(file=>file.key===action.payload.key).length===0){ - state.data.push(action.payload) + state.data.push({"label":action.payload.label,"key":action.payload.key,"children":action.payload.children}) } if (action.payload.activeKey){ state.activeKey=action.payload.activeKey