popconfirm支持disabled

master
yutent 2024-01-26 17:52:25 +08:00
parent 9c52169a5b
commit ab2a1945f2
1 changed files with 15 additions and 2 deletions

View File

@ -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
}