- 添加 .editorconfig 文件统一代码风格 - 配置 .env.development 环境变量文件 - 创建 .env.example 环境变量示例文件 - 设置 .eslintignore 忽略检查规则 - 配置 .eslintrc.js 代码检查规则 - 添加 .gitignore 文件忽略版本控制 - 设置 .prettierignore 忽略格式化规则 - 新增隐私政策HTML页面文件 - 创建API密钥编辑组件基础结构
52 lines
972 B
Vue
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>
|