FormLayout.vue 655 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import { computed } from 'vue'
  4. interface Props {
  5. columns?: number
  6. }
  7. const props = withDefaults(defineProps<Props>(), {
  8. columns: 1,
  9. })
  10. const columnClass = computed(() => {
  11. return `column-${props.columns}`
  12. })
  13. </script>
  14. <template>
  15. <fieldset class="flex flex-wrap" :class="columnClass">
  16. <slot />
  17. </fieldset>
  18. </template>
  19. <style lang="postcss">
  20. fieldset.column-1 > .formkit-outer {
  21. @apply w-full;
  22. }
  23. fieldset.column-2 > .formkit-outer {
  24. @apply w-1/2;
  25. }
  26. fieldset.column-2 > .formkit-outer:first-child {
  27. @apply pr-3;
  28. }
  29. </style>