commonDes.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <a-descriptions :column="column"
  3. :bordered="bordered"
  4. class="commom-des">
  5. <a-descriptions-item v-for="(item, i) in list"
  6. :key="i + 'des'"
  7. :label="item.label">
  8. <span class="white">{{item.value}}</span>
  9. </a-descriptions-item>
  10. <a-descriptions-item v-if="slotDesName"
  11. :label="slotDesName">
  12. <slot></slot>
  13. </a-descriptions-item>
  14. </a-descriptions>
  15. </template>
  16. <script lang="ts">
  17. import { defineComponent, PropType } from 'vue';
  18. import { DescriptionsList } from './interface';
  19. export default defineComponent({
  20. name: 'des-list',
  21. components: {},
  22. props: {
  23. column: {
  24. // 一行的 DescriptionItems 数量
  25. type: Number,
  26. default: 2,
  27. },
  28. bordered: {
  29. // 是否展示边框
  30. type: Boolean,
  31. default: false,
  32. },
  33. slotDesName: {
  34. // 使用插槽的时候,DescriptionItems 的内容描述
  35. type: String,
  36. default: '',
  37. },
  38. list: {
  39. type: Array as PropType<DescriptionsList[]>,
  40. default: [],
  41. },
  42. },
  43. setup() {},
  44. });
  45. </script>
  46. <style lang="less">
  47. .commom-des {
  48. }
  49. </style>;