fix:处理保存格式
This commit is contained in:
parent
dc537ef714
commit
8e07b42789
|
@ -190,7 +190,7 @@ const ItemTree = (prop) => {
|
||||||
} else {
|
} else {
|
||||||
// 打开文件
|
// 打开文件
|
||||||
dispatch(addTableBarItem({
|
dispatch(addTableBarItem({
|
||||||
label: e.node.title,
|
label: e.node.title.props.children[0],
|
||||||
children: e.node.key,
|
children: e.node.key,
|
||||||
key: e.node.key,
|
key: e.node.key,
|
||||||
activeKey: e.node.key
|
activeKey: e.node.key
|
||||||
|
|
|
@ -18,9 +18,9 @@ export const tableBarItemSlice = createSlice({
|
||||||
},
|
},
|
||||||
reducers: {
|
reducers: {
|
||||||
addTableBarItem: (state, action) => {
|
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){
|
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){
|
if (action.payload.activeKey){
|
||||||
state.activeKey=action.payload.activeKey
|
state.activeKey=action.payload.activeKey
|
||||||
|
|
Loading…
Reference in New Issue