naive-ui/demo/documentation/components/notification/enUS/closable.md
2020-02-04 14:10:35 +08:00

753 B

Unclosable

You can make it unclosable.

<n-button @click="notify('info')">
  Unclosable
</n-button>
export default {
  methods: {
    notify (type) {
      this.$NNotification.open({
        title: `Close Me if You Can`,
        duration: 2000,
        closable: false,
        onAfterHide: () => {
          this.$NNotification.open({
            title: `Ha Ha Ha Ha!`,
            duration: 2000,
            closable: false,
            onAfterHide: () => {
              this.$NNotification.open({
                title: `No, You Can't`,
                duration: 2000,
                closable: false,
              })
            }
          })
        }
      })
    }
  }
}
.n-button {
  margin: 0 12px 8px 0;
}