---
layout: templateLayout
---
```vue
<template>
    <Wb-switch :confirm="confirm"></Wb-switch>
</template>
<script>
export default {
    methods: {
        confirm() {
            return new Promise((resolve, reject)=>{
                this.$Message({
                    title: '警告', // 可以传入文本和domString
                    template: '是否切换状态？', // 可以传入文本和domString
                }).then(function (index) {
                    if (index == 0) {
                        resolve()
                    }
                })
            })
        },
    }
}
</script>
```