---
layout: templateLayout
---
```vue
<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>
```