tab增加退出清空功能;

增加userId == 8的判断
This commit is contained in:
linxd
2025-08-05 17:06:22 +08:00
parent 08ca7af8a5
commit 8aaaf5ce5e
8 changed files with 32 additions and 13 deletions

View File

@ -21,6 +21,7 @@ export interface TabModelType {
addTab: Effect;
closeTab: Effect;
switchTab: Effect;
clearTab: Effect; // 新增清空tab的effect
};
reducers: {
updateState: Reducer<TabModelState>;
@ -84,7 +85,17 @@ const TabModel: TabModelType = {
});
}
},
//清空tab
*clearTab({ payload }, { call, put }) {
// 清空tab列表
yield put({
type: 'updateState',
payload: {
tabList: [],
activeKey: '/',
},
});
},
*closeTab({ payload }, { call, put, select }) {
const { key } = payload;
const { tabList, activeKey } = yield select((state: any) => state.tab);