feat: add visible

This commit is contained in:
hufeixiong
2021-12-14 16:15:35 +08:00
parent 178f0d7b9f
commit 7d018faa59
7 changed files with 58 additions and 3 deletions

View File

@@ -50,6 +50,15 @@ const ContextMenu = () => {
>
<Button></Button>
</div>
<div
style={{ width: '100%' }}
onClick={() => {
commander.exec('hide');
handleclick();
}}
>
<Button style={{ width: '100%' }}></Button>
</div>
<div
style={{ width: '100%' }}
onClick={() => {

View File

@@ -0,0 +1,20 @@
import deepcopy from 'deepcopy';
import { CommanderItemFactory } from 'dooringx-lib';
import { IStoreData } from 'dooringx-lib/dist/core/store/storetype';
const hide = new CommanderItemFactory(
'hide',
'',
(store) => {
const clonedata: IStoreData = deepcopy(store.getData());
clonedata.block.forEach((v) => {
if (v.focus) {
v.canSee = false;
}
});
store.setData(clonedata);
},
'隐藏'
);
export default hide;