合并代码
This commit is contained in:
27
src/models/globalModal.ts
Normal file
27
src/models/globalModal.ts
Normal file
@ -0,0 +1,27 @@
|
||||
// src/models/globalModal.ts
|
||||
export default {
|
||||
namespace: 'globalModal',
|
||||
state: {
|
||||
visible: false,
|
||||
title: '',
|
||||
id: '',
|
||||
},
|
||||
reducers: {
|
||||
show(state:any, { payload }:any ) {
|
||||
return {
|
||||
...state,
|
||||
visible: true,
|
||||
id: payload.id
|
||||
};
|
||||
},
|
||||
hide(state:any ) {
|
||||
return {
|
||||
...state,
|
||||
visible: false,
|
||||
title: '',
|
||||
id: ''
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
|
5
src/models/index.ts
Normal file
5
src/models/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import globalModal from './globalModal';
|
||||
export default {
|
||||
globalModal,
|
||||
// ... 其他 models
|
||||
};
|
Reference in New Issue
Block a user