Expand.vue 671 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <div
  3. class="relative flex flex-col overflow-hidden space-y-2"
  4. :class="expand ? 'h-full' : 'max-h-32'"
  5. >
  6. <slot name="body"></slot>
  7. <div class="sticky inset-x-0 bottom-0 flex items-center justify-center">
  8. <ButtonSecondary
  9. :icon="expand ? 'expand_less' : 'expand_more'"
  10. :label="expand ? t('action.less') : t('action.more')"
  11. filled
  12. rounded
  13. @click.native="expand = !expand"
  14. />
  15. </div>
  16. </div>
  17. </template>
  18. <script setup lang="ts">
  19. import { ref } from "@nuxtjs/composition-api"
  20. import { useI18n } from "~/helpers/utils/composables"
  21. const t = useI18n()
  22. const expand = ref(false)
  23. </script>