close-button.vue 466 B

1234567891011121314151617181920
  1. <template>
  2. <el-alert title="unclosable alert" type="success" :closable="false" />
  3. <el-alert title="customized close-text" type="info" close-text="Gotcha" />
  4. <el-alert title="alert with callback" type="warning" @close="hello" />
  5. </template>
  6. <script lang="ts" setup>
  7. const hello = () => {
  8. // eslint-disable-next-line no-alert
  9. alert('Hello World!')
  10. }
  11. </script>
  12. <style scoped>
  13. .el-alert {
  14. margin: 20px 0 0;
  15. }
  16. .el-alert:first-child {
  17. margin: 0;
  18. }
  19. </style>