This commit is contained in:
梁灏 2017-10-23 14:12:02 +08:00
parent 6ed0cd7377
commit b75ad4a120
2 changed files with 16 additions and 16 deletions

View file

@ -1,19 +1,10 @@
<template>
<div style="margin: 100px;">
<Poptip
confirm
transfer
title="您确认删除这条内容吗?"
@on-ok="ok"
@on-cancel="cancel">
<Button>删除</Button>
</Poptip>
<Poptip
confirm
title="您确认删除这条内容吗?"
@on-ok="ok"
@on-cancel="cancel">
<Button>删除</Button>
<div style="margin: 200px;">
<Poptip title="提示标题" transfer>
<div slot="content" style="padding: 50px">
<Button>click me</Button>
</div>
<Button>click 激活</Button>
</Poptip>
</div>
</template>

View file

@ -18,6 +18,7 @@
:style="styles"
ref="popper"
v-show="visible"
@click="handleTransferClick"
@mouseenter="handleMouseenter"
@mouseleave="handleMouseleave"
:data-transfer="transfer"
@ -102,7 +103,8 @@
return {
prefixCls: prefixCls,
showTitle: true,
isInput: false
isInput: false,
disableCloseUnderTransfer: false, // transfer slot
};
},
computed: {
@ -156,7 +158,14 @@
}
this.visible = !this.visible;
},
handleTransferClick () {
if (this.transfer) this.disableCloseUnderTransfer = true;
},
handleClose () {
if (this.disableCloseUnderTransfer) {
this.disableCloseUnderTransfer = false;
return false;
}
if (this.confirm) {
this.visible = false;
return true;