Skip to content

Commit

Permalink
feat(script): 添加页面关闭提示
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Mar 7, 2023
1 parent 83f3e6f commit 477fb01
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/core/src/projects/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,23 @@ const RenderScript = new Script({
className: 'close ',
innerText: 'x',
title: '点击关闭窗口(不会影响脚本运行,连续点击三次页面任意位置可以重新唤出窗口)',
onclick: () => (this.cfg.visual = 'close')
onclick: () => {
if (this.cfg.firstCloseAlert) {
$model('confirm', {
content: $creator.notes([
'关闭脚本页面后,快速点击页面三下(可以在悬浮窗设置中调整次数)即可重新显示脚本。',
'请确认是否关闭。(此后不再显示此弹窗)'
]),
onConfirm: () => {
this.cfg.visual = 'close'
this.cfg.firstCloseAlert = false
},
})
} else {
this.cfg.visual = 'close'
}

}
})
);

Expand Down

0 comments on commit 477fb01

Please sign in to comment.