index.vue 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!-- 抽屉弹框组件 -->
  2. <template>
  3. <app-modal class="app-drawer" :show="show" :close-on-click-mask="false" @mask="close">
  4. <div class="app-drawer__wrapper" v-loading="loading">
  5. <div class="app-drawer__header">
  6. <h1>{{ title }}</h1>
  7. <el-icon @click="close">
  8. <Close />
  9. </el-icon>
  10. </div>
  11. <div class="app-drawer__body">
  12. <slot></slot>
  13. </div>
  14. <div class="app-drawer__footer" v-if="$slots.footer">
  15. <slot name="footer"></slot>
  16. </div>
  17. </div>
  18. </app-modal>
  19. </template>
  20. <script lang="ts" setup>
  21. import AppModal from '@/components/base/modal/index.vue'
  22. const emit = defineEmits(['update:show'])
  23. defineProps({
  24. show: {
  25. type: Boolean,
  26. default: false,
  27. },
  28. title: {
  29. type: String,
  30. default: '',
  31. },
  32. loading: {
  33. type: Boolean,
  34. default: false,
  35. },
  36. })
  37. const close = () => {
  38. emit('update:show', false);
  39. }
  40. </script>
  41. <style lang="less">
  42. @import './index.less';
  43. </style>