<script setup lang="ts">
const props = defineProps({
px: {
type: String,
required: false,
},
bg: {
type: String,
default: 'transparent',
},
rounded: {
type: String,
default: 'none',
}
})
const classes = []
for (const [key, value] of Object.entries(props)) {
(value !== undefined) && classes.push(`${key}-${value}`)
}
</script>
<template>
<div :class="classes" class="overflow-hidden">
<slot></slot>
</div>
</template>
Because the props is reactive, so I think the DOM will finish rendering before script's process. How can I let the component wait for script's process? Thanks.
the classed has been added but it's reactive so they don't effect...
