naive-ui/demo/documentation/components/notification/enUS/closable.md
2020-01-30 23:23:51 +08:00

751 B

Closable

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;
}