ant-design-vue/components/modal/demo/manual.md

512 B

#### 手动移除 手动关闭modal。 #### Manual to destroy Manually destroying a modal.
<template>
  <a-button @click="success">Success</a-button>
</template>
<script>
import { Modal } from 'antd'
export default {
  methods: {
    success() {
      const modal = Modal.success({
        title: 'This is a notification message',
        content: 'This modal will be destroyed after 1 second',
      });
      setTimeout(() => modal.destroy(), 1000);
    }
  }
}
</script>