From ab2a1945f21fce4c45e9b817444d450b181eb2d6 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 26 Jan 2024 17:52:25 +0800 Subject: [PATCH] =?UTF-8?q?popconfirm=E6=94=AF=E6=8C=81disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modal/popconfirm.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/modal/popconfirm.js b/src/modal/popconfirm.js index cc83745..b174bc6 100644 --- a/src/modal/popconfirm.js +++ b/src/modal/popconfirm.js @@ -23,7 +23,8 @@ const DEFAULT_TIPS = '请确认你的操作!' class PopConfirm extends Component { static props = { title: 'str!', - confirmButtonType: 'str!primary' + confirmButtonType: 'str!primary', + disabled: false } static styles = [ @@ -34,6 +35,18 @@ class PopConfirm extends Component { .container { position: relative; + + .wrapper { + cursor: pointer; + } + } + + :host([disabled]) { + opacity: 0.6; + + .container .wrapper { + cursor: not-allowed; + } } .tooltip { @@ -144,7 +157,7 @@ class PopConfirm extends Component { let styles = { display: 'block' } let st = document.documentElement.scrollTop - if (this.#poped) { + if (this.disabled || this.#poped) { return }