<template>
  <div class="demo-notification-buttons">
    <ui-button @click="handleClick">
      显示通知
    </ui-button>
  </div>
</template>

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

export default {
  components: {
    "ui-button": Button,
  },
  data() {
    return {
      visible: false,
    }
  },
  methods: {
    handleClick() {
      notification({
        title: "通知",
        message: "你有一条新的日程待处理。",
        closable: false,
        duration: 0,
        buttons: [
          {
            text: "关闭",
          },
          {
            text: "处理",
            onClick: this.click,
          },
        ],
      })
    },
    click() {
      message.info({
        message: "处理成功。",
        duration: 3,
      })
    },
  },
}
</script>
