fix: 合并`github`分支问题修复
This commit is contained in:
commit
27699dcc21
|
|
@ -33,4 +33,6 @@ module.exports = {
|
||||||
useTabs: false,
|
useTabs: false,
|
||||||
// vue 文件中是否缩进 <style> 和 <script> 标签,默认 false
|
// vue 文件中是否缩进 <style> 和 <script> 标签,默认 false
|
||||||
vueIndentScriptAndStyle: false,
|
vueIndentScriptAndStyle: false,
|
||||||
|
|
||||||
|
endOfLine: "auto",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
clearable
|
clearable
|
||||||
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="option in options"
|
v-for="option in options"
|
||||||
|
|
@ -20,6 +21,9 @@
|
||||||
import { getDictOptions } from "@/api/dict";
|
import { getDictOptions } from "@/api/dict";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
/**
|
||||||
|
* 字典类型编码(eg: 性别-gender)
|
||||||
|
*/
|
||||||
typeCode: {
|
typeCode: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -38,11 +42,15 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(["update:modelValue"]);
|
const emits = defineEmits(["update:modelValue"]); // 父组件监听事件,同步子组件值的变化给父组件
|
||||||
|
|
||||||
const selectedValue = useVModel(props, "modelValue", emits);
|
const options: Ref<OptionType[]> = ref([]); // 字典下拉数据源
|
||||||
|
|
||||||
const options: Ref<OptionType[]> = ref([]);
|
const selectedValue = computed(() => props.modelValue.toString()); // 将父组件的值统一转化String和下拉数据源进行比较,避免值的类型不一致导致回显失败
|
||||||
|
|
||||||
|
function handleChange(val?: string) {
|
||||||
|
emits("update:modelValue", val);
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
// 根据字典类型编码(typeCode)获取字典选项
|
// 根据字典类型编码(typeCode)获取字典选项
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ declare global {
|
||||||
/**
|
/**
|
||||||
* 值
|
* 值
|
||||||
*/
|
*/
|
||||||
value: number;
|
value: string;
|
||||||
/**
|
/**
|
||||||
* 文本
|
* 文本
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<!-- 字典组件示例 -->
|
<!-- 字典组件示例 -->
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const genderDefaultValue = ref("1"); // 性别默认
|
const stringValue = ref("1"); // 性别(值为String)
|
||||||
|
const nmberValue = ref(1); // 性别(值为Number)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -14,7 +15,17 @@ const genderDefaultValue = ref("1"); // 性别默认
|
||||||
>
|
>
|
||||||
<el-form>
|
<el-form>
|
||||||
<el-form-item label="性别">
|
<el-form-item label="性别">
|
||||||
<dictionary v-model="genderDefaultValue" type-code="gender" />
|
<dictionary v-model="stringValue" type-code="gender" />
|
||||||
|
<el-link :underline="false" type="primary" class="ml-5"
|
||||||
|
>值为String: const value = ref("1");
|
||||||
|
</el-link>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="性别">
|
||||||
|
<dictionary v-model="nmberValue" type-code="gender" />
|
||||||
|
<el-link :underline="false" type="success" class="ml-5"
|
||||||
|
>值为Number: const value = ref(1);
|
||||||
|
</el-link>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -374,6 +374,7 @@ const readFile = (file: any, callback: any) => {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 84px);
|
height: calc(100vh - 84px);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
.table-wrap {
|
.table-wrap {
|
||||||
// height: 100%;
|
// height: 100%;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue