Files
mp-10584/src/components/DictRadio/index.vue
赵忠林 482e2a2718 chore(config): 添加项目配置文件和隐私协议
- 添加 .editorconfig 文件统一代码风格
- 添加 .env.development 和 .env.example 环境配置文件
- 添加 .eslintignore 和 .eslintrc.js 代码检查配置
- 添加 .gitignore 版本控制忽略文件配置
- 添加 .prettierignore 格式化忽略配置
- 添加隐私协议HTML文件
- 添加API密钥管理组件基础结构
2026-01-26 14:05:01 +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>