<script>
export default {
	inheritAttrs: false,
}
</script>
<script setup>
// 常用属性：
//   name - 字段名

import RadioButton from "primevue/radiobutton";
import {ref} from "vue";

const props = defineProps(["inputId"])

const inputId = ref("checkbox-" + Math.random().toString().replace(/\./, "").substring(0, 6))
if (typeof props.inputId === "string") {
	inputId.value = props.inputId
}
</script>

<template>
	<div class="inline-block">
		<div :class="{'flex flex-row gap-[8px] items-center':$slots.default}">
			<RadioButton v-bind="$attrs" :inputId="inputId"></RadioButton>
			<label :for="inputId" v-if="$slots.default">
				<slot></slot>
			</label>
		</div>
	</div>
</template>

<style scoped>

</style>