index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div class="select-media-wrap">
  3. <Modal
  4. title="选择直播素材"
  5. :mask-closable="false"
  6. @close="emits('close')"
  7. >
  8. <div class="container">
  9. <n-space justify="center">
  10. <n-button
  11. v-for="(item, index) in allMediaTypeList"
  12. :key="index"
  13. class="item"
  14. @click="emits('ok', item.type)"
  15. >
  16. {{ item.txt }}
  17. </n-button>
  18. </n-space>
  19. </div>
  20. <template #footer></template>
  21. </Modal>
  22. </div>
  23. </template>
  24. <script lang="ts" setup>
  25. import { onMounted } from 'vue';
  26. import { MediaTypeEnum } from '@/interface';
  27. const props = withDefaults(
  28. defineProps<{
  29. allMediaTypeList: {
  30. [index: string]: {
  31. type: MediaTypeEnum;
  32. txt: string;
  33. };
  34. };
  35. }>(),
  36. {}
  37. );
  38. const emits = defineEmits(['close', 'ok']);
  39. onMounted(() => {});
  40. </script>
  41. <style lang="scss" scoped>
  42. .select-media-wrap {
  43. text-align: initial;
  44. .container {
  45. padding-top: 10px;
  46. }
  47. }
  48. </style>