add close back

This commit is contained in:
zhw2590582 committed 2020-03-19 22:22:50 +08:00
1 parent 03e3fa496f
commit 8fe0630ab3
4 files changed
+52 -13

No files matched your search

@@ -0,0 +1,9 @@
export default function close(option) {
return art => ({
...option,
html: art.i18n.get('Close'),
click: contextmenu => {
contextmenu.show = false;
},
});
}
@@ -5,6 +5,7 @@ import aspectRatio from './aspectRatio';
import info from './info';
import version from './version';
import light from './light';
import close from './close';
export default class Contextmenu extends Component {
constructor(art) {
@@ -61,6 +62,14 @@ export default class Contextmenu extends Component {
}),
);
this.add(
close({
disable: false,
name: 'close',
index: 60,
}),
);
option.contextmenu.forEach(item => {
this.add(item);
});