2020-08-27 17:18:57 +08:00

692 B
Raw Blame History

layout
templateLayout
<template>
    <Wb-button @click='showModal4'>显示弹窗</Wb-button>
    <modal ref="modal4"
            title="我是标题"
            sub-title="我是副标题"
            :beforeClose="beforeClose">
        我是内容我是内容
    </modal>
</template>
<script>
export default {
    methods: {
        showModal4 () {
            this.$refs.modal4.show()
        },
        beforeClose(){
            return new Promise((resolve, reject)=>{
                this.$Message.confirm("是否关闭模态框?").then(function (index) {
                    resolve(index === 0)
                })
            })
        },
    }
}
</script>