fix: refactor containerClasses and containerStyle to use cn() and prevent undefined behaviour

This commit is contained in:
Johnpaul
2025-09-23 06:30:07 +01:00
parent 27e4ee5bd5
commit b6b4a562b9
2 changed files with 6 additions and 4 deletions

View File

@@ -7,11 +7,13 @@
<script setup lang="ts">
import { computed } from 'vue'
import { cn } from '@/utils/tailwindUtil'
const { fullHeight = true } = defineProps<{
fullHeight?: boolean
}>()
const containerClasses = computed(
() => `flex-1 w-full${fullHeight ? ' h-full' : ''}`
const containerClasses = computed(() =>
cn('flex-1 w-full', fullHeight && 'h-full')
)
</script>

View File

@@ -35,8 +35,8 @@ const containerClasses = computed(() => {
const containerStyle = computed(() =>
maxWidth || minWidth
? {
maxWidth: `${maxWidth}px`,
minWidth: `${minWidth}px`
maxWidth: maxWidth ? `${maxWidth}px` : undefined,
minWidth: minWidth ? `${minWidth}px` : undefined
}
: {}
)