Files
template-10561/src/views/cms/cmsArticle/dictionary/source-select.vue
赵忠林 37f3b6327c feat: 初始化项目配置和文档- 添加 .editorconfig 文件,配置代码编辑规范
- 添加 .env 及相关文件,配置环境变量
- 添加 .eslintignore 和 .eslintrc.js 文件,配置 ESLint 规则
- 添加 .gitignore 文件,配置 Git忽略项
- 添加 .prettierignore 文件,配置 Prettier 忽略项
- 添加隐私政策文档,详细说明用户数据的收集和使用
2025-08-23 20:31:46 +08:00

52 lines
972 B
Vue

<!-- 文章来源选择下拉框 -->
<template>
<a-select
optionFilterProp="label"
:options="data"
allow-clear
:value="value"
:placeholder="placeholder"
@update:value="updateValue"
@blur="onBlur"
@change="onChange"
/>
</template>
<script lang="ts" setup>
import { getDictionaryOptions } from '@/utils/common';
const emit = defineEmits<{
(e: 'update:value', value: string): void;
(e: 'blur'): void;
(e: 'change'): void;
}>();
withDefaults(
defineProps<{
value?: string;
placeholder?: string;
}>(),
{
placeholder: '请选择文章来源'
}
);
// 字典数据
const data = getDictionaryOptions('articleSource');
/* 更新选中数据 */
const updateValue = (value: string) => {
emit('update:value', value);
};
/* 失去焦点 */
const onBlur = () => {
emit('blur');
};
/* 选择事件 */
const onChange = () => {
emit('change');
};
</script>