ParameterTable.vue 789 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="para-tab-wrap">
  3. <div v-for="(item, index) in items" :key="index" class="para-tab-row">
  4. <div class="para-tab-name" :style="{ width: labelWidth }">{{ item.name }}</div>
  5. <div class="para-tab-content" v-html="item.content"></div>
  6. </div>
  7. </div>
  8. </template>
  9. <script setup>
  10. defineProps({
  11. labelWidth: {
  12. type: String,
  13. default: '150px' // 默认 150px
  14. },
  15. items: {
  16. type: Array,
  17. required: true,
  18. default: () => []
  19. }
  20. });
  21. </script>
  22. <style scoped>
  23. .para-tab-wrap {
  24. display: flex;
  25. flex-direction: column;
  26. gap: 20px;
  27. width: 100%;
  28. padding-top: 30px;
  29. padding-bottom: 30px;
  30. }
  31. .para-tab-row {
  32. display: flex;
  33. gap: 20px;
  34. }
  35. .para-tab-name {
  36. font-weight: bold;
  37. color: #333;
  38. }
  39. .para-tab-content {
  40. flex: 1;
  41. }
  42. </style>