Files
mp-vue/src/components/DictRadio/index.vue
赵忠林 82ac209505 style(api): 统一代码风格并修复语法问题
- 统一import语句的空格格式
- 修复分号缺失问题
- 调整函数参数换行格式以符合规范
- 删除多余空行保持代码整洁
- 修复字符串拼接的换行格式问题
2026-01-21 00:26:14 +08:00

59 lines
1.2 KiB
Vue

<!-- 选择下拉框 -->
<template>
<a-radio-group
v-model:value="content"
:placeholder="placeholder"
@update:value="updateValue"
@blur="onBlur"
>
<a-radio-button
:value="item.value"
v-for="(item, index) in data"
:key="index"
>
{{ item.label }}
</a-radio-button>
</a-radio-group>
<!-- <a-radio-group-->
<!-- :value="value"-->
<!-- :options="data"-->
<!-- :placeholder="placeholder"-->
<!-- @update:value="updateValue"-->
<!-- @blur="onBlur"-->
<!-- />-->
</template>
<script lang="ts" setup>
import { getDictionaryOptions } from '@/utils/common';
const emit = defineEmits<{
(e: 'update:value', value: string): void;
(e: 'blur'): void;
}>();
const props = withDefaults(
defineProps<{
value?: any;
type?: any;
placeholder?: string;
dictCode?: string;
}>(),
{
placeholder: '请选择服务器厂商'
}
);
// 字典数据
const data = getDictionaryOptions(props.dictCode);
const content = ref<any>();
/* 更新选中数据 */
const updateValue = () => {
emit('update:value', content.value);
};
/* 失去焦点 */
const onBlur = () => {
emit('blur');
};
</script>