44 lines
876 B
Vue
44 lines
876 B
Vue
<!-- 类型选择 -->
|
|
<template>
|
|
<a-radio-group
|
|
:value="value"
|
|
@blur="onBlur"
|
|
@update:value="updateValue"
|
|
:options="data"
|
|
/>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { getDictionaryOptions } from '@/utils/common';
|
|
import { getLinkType } from '@/api/apps/link';
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'update:value', value: string): void;
|
|
(e: 'blur'): void;
|
|
}>();
|
|
|
|
withDefaults(
|
|
defineProps<{
|
|
value?: string;
|
|
placeholder?: string;
|
|
dictCode?: string;
|
|
}>(),
|
|
{
|
|
placeholder: '请选择'
|
|
}
|
|
);
|
|
|
|
// 字典数据(如未定义字典数据取默认值)
|
|
const data = getDictionaryOptions('linkType') || getLinkType();
|
|
|
|
/* 更新选中数据 */
|
|
const updateValue = (value: string) => {
|
|
emit('update:value', value);
|
|
};
|
|
|
|
/* 失去焦点 */
|
|
const onBlur = () => {
|
|
emit('blur');
|
|
};
|
|
</script>
|