<script setup>
const {label} = defineProps({
    label: {
        type: String,
        default: null,
    }
});
</script>

<template>
    <view class="x-form-item">
        <view class="!mb-[8rpx] x-form-item-label" v-if="!$slots.label && label">{{ label }}</view>
        <slot name="label" v-else></slot>
        <slot></slot>
    </view>
</template>

<style scoped lang="scss">
.x-form-item {
    margin-bottom: 20rpx;
}
</style>
