SettingItemBox.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <div class="go-config-item-box">
  3. <n-text class="item-left" depth="2">
  4. {{ name }}
  5. <n-space :size="5">
  6. <slot name="name"></slot>
  7. </n-space>
  8. </n-text>
  9. <div
  10. class="item-right"
  11. :style="{
  12. gridTemplateColumns: alone ? '1fr' : '1fr 1fr',
  13. ...itemRightStyle
  14. }"
  15. >
  16. <slot></slot>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup lang="ts">
  21. defineProps({
  22. name: {
  23. type: String,
  24. required: false
  25. },
  26. alone: {
  27. type: Boolean,
  28. default: false,
  29. required: false
  30. },
  31. itemRightStyle: {
  32. type: Object,
  33. default: () => {},
  34. required: false
  35. }
  36. })
  37. </script>
  38. <style lang="scss" scoped>
  39. $leftWidth: 60px;
  40. @include go('config-item-box') {
  41. position: relative;
  42. display: flex;
  43. margin: 20px 0;
  44. .item-left {
  45. width: $leftWidth;
  46. text-align: left;
  47. margin-top: 4px;
  48. margin-left: 10px;
  49. font-size: 12px;
  50. }
  51. .item-right {
  52. display: grid;
  53. grid-column-gap: 10px;
  54. width: calc(100% - #{$leftWidth});
  55. }
  56. }
  57. </style>