父组件:

    1. <SignOutTipDialog
    2. :signoutDialogVis="signoutDialogVis"
    3. @close="closeSignOutEvent"
    4. />
    5. data() {
    6. return {
    7. signoutDialogVis: false,
    8. }
    9. }
    10. methods: {
    11. //关闭的事件
    12. closeSignOutEvent(val) {
    13. console.log('closeSignOutEvent',val);
    14. this.signoutDialogVis = val.isClose;
    15. if(val.confirm) {
    16. //调接口
    17. }
    18. }
    19. }

    子组件:

    1. <!--签退提示-->
    2. <template>
    3. <div class="sign-out-dialog-container">
    4. <el-dialog
    5. title="签退提示"
    6. :visible.sync="signoutDialogVis"
    7. width="30%"
    8. :before-close="handleClose"
    9. >
    10. <span class="center">确定退出当前RPA机器人端账户的登录状态吗?</span>
    11. <span slot="footer" class="dialog-footer">
    12. <el-button @click="cancelEvent">取 消</el-button>
    13. <el-button type="primary" @click="confirmEvent">确 定</el-button>
    14. </span>
    15. </el-dialog>
    16. </div>
    17. </template>
    18. <script>
    19. export default {
    20. props: {
    21. signoutDialogVis: {
    22. type: Boolean,
    23. default: false
    24. }
    25. },
    26. data() {
    27. return {
    28. }
    29. },
    30. methods: {
    31. //关闭
    32. handleClose() {
    33. this.$emit('close',{
    34. isClose: false,
    35. });
    36. },
    37. //取消
    38. cancelEvent() {
    39. this.$emit('close',{
    40. isClose: false,
    41. });
    42. },
    43. //确定
    44. confirmEvent() {
    45. this.$emit('close',{
    46. confirm: true,
    47. isClose: false,
    48. });
    49. }
    50. }
    51. }
    52. </script>
    53. <style lang="scss" scoped>
    54. .sign-out-dialog-container {
    55. }
    56. </style>