index.vue 744 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <el-alert
  3. :center="center"
  4. :closable="closable"
  5. :close-text="closeText"
  6. :description="description"
  7. :effect="effect"
  8. :show-icon="showIcon"
  9. :title="title"
  10. :type="type"
  11. v-bind="$attrs"
  12. >
  13. <template v-if="title || $slots.title" #title>
  14. <slot name="title">
  15. {{ title }}
  16. </slot>
  17. </template>
  18. <template v-if="$slots.default || description" #default>
  19. <slot name="default">
  20. {{ description }}
  21. </slot>
  22. </template>
  23. </el-alert>
  24. </template>
  25. <script lang="ts" setup>
  26. import { ElAlert } from 'element-plus'
  27. defineOptions({
  28. name: 'VabAlert',
  29. })
  30. defineProps({
  31. ...ElAlert.props,
  32. closable: {
  33. type: Boolean,
  34. default: false,
  35. },
  36. })
  37. </script>