<template>
  <div class="demo-dialog-html">
    <ui-button @click="handleConfirm">
      弹出确认
    </ui-button>
  </div>
</template>

<script>
import { Button } from "amumu-ui"
import { dialog, message } from "amumu-ui/src/factory"

export default {
  components: {
    "ui-button": Button,
  },
  methods: {
    handleConfirm() {
      dialog.confirm({
        title: "提示",
        message: "<span>次标题</span><div>点击此处<a href=\"/\">返回首页</a>。</div>",
        messageIsHtml: true,
        type: "success",
      })
        .then(() => {
          message.success("已确认！")
        })
        .catch(() => {
          message.info("取消。")
        })
    },
  },
}
</script>
<style lang="scss">
.demo-dialog-html {
  .mm-button {
    margin-right: 10px;
  }
}
</style>
