mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat: 测试代码生成
This commit is contained in:
28
src/components/custom/dict-radio.vue
Normal file
28
src/components/custom/dict-radio.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import { useDict } from '@/hooks/business/dict';
|
||||
|
||||
defineOptions({ name: 'DictRadio' });
|
||||
|
||||
interface Props {
|
||||
dictCode: string;
|
||||
immediate?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
immediate: true
|
||||
});
|
||||
|
||||
const value = defineModel<string | null>('value', { required: false });
|
||||
|
||||
const { options } = useDict(props.dictCode, props.immediate);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NRadioGroup v-model:value="value">
|
||||
<NSpace>
|
||||
<NRadio v-for="option in options" :key="option.value" :value="option.value" :label="option.label" />
|
||||
</NSpace>
|
||||
</NRadioGroup>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
Reference in New Issue
Block a user