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 { class PopConfirm extends Component {
static props = { static props = {
title: 'str!', title: 'str!',
confirmButtonType: 'str!primary' confirmButtonType: 'str!primary',
disabled: false
} }
static styles = [ static styles = [
@ -34,6 +35,18 @@ class PopConfirm extends Component {
.container { .container {
position: relative; position: relative;
.wrapper {
cursor: pointer;
}
}
:host([disabled]) {
opacity: 0.6;
.container .wrapper {
cursor: not-allowed;
}
} }
.tooltip { .tooltip {
@ -144,7 +157,7 @@ class PopConfirm extends Component {
let styles = { display: 'block' } let styles = { display: 'block' }
let st = document.documentElement.scrollTop let st = document.documentElement.scrollTop
if (this.#poped) { if (this.disabled || this.#poped) {
return return
} }