<template>
  <div class="demo-dialog-vnode">
    <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() {
      const h = this.$createElement
      dialog
        .confirm({
          title: "提示",
          message: h("p", null, [
            h("span", null, "内容可以是 "),
            h("i", { style: "color: teal" }, "VNode"),
          ]),
          type: "success",
        })
        .then(() => {
          message.success("已确认！")
        })
        .catch(() => {
          message.info("取消。")
        })
    },
  },
}
</script>
<style lang="scss">
.demo-dialog-vnode {
  .mm-button {
    margin-right: 10px;
  }
}
</style>
