父组件:
<SignOutTipDialog
:signoutDialogVis="signoutDialogVis"
@close="closeSignOutEvent"
/>
data() {
return {
signoutDialogVis: false,
}
}
methods: {
//关闭的事件
closeSignOutEvent(val) {
console.log('closeSignOutEvent',val);
this.signoutDialogVis = val.isClose;
if(val.confirm) {
//调接口
}
}
}
子组件:
<!--签退提示-->
<template>
<div class="sign-out-dialog-container">
<el-dialog
title="签退提示"
:visible.sync="signoutDialogVis"
width="30%"
:before-close="handleClose"
>
<span class="center">确定退出当前RPA机器人端账户的登录状态吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="cancelEvent">取 消</el-button>
<el-button type="primary" @click="confirmEvent">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
signoutDialogVis: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
//关闭
handleClose() {
this.$emit('close',{
isClose: false,
});
},
//取消
cancelEvent() {
this.$emit('close',{
isClose: false,
});
},
//确定
confirmEvent() {
this.$emit('close',{
confirm: true,
isClose: false,
});
}
}
}
</script>
<style lang="scss" scoped>
.sign-out-dialog-container {
}
</style>