fix: 合并`github`分支问题修复

This commit is contained in:
hxr 2023-08-07 23:58:21 +08:00
commit 27699dcc21
6 changed files with 28 additions and 6 deletions

View File

@ -33,4 +33,6 @@ module.exports = {
useTabs: false, useTabs: false,
// vue 文件中是否缩进 <style> 和 <script> 标签,默认 false // vue 文件中是否缩进 <style> 和 <script> 标签,默认 false
vueIndentScriptAndStyle: false, vueIndentScriptAndStyle: false,
endOfLine: "auto",
}; };

View File

@ -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)

View File

@ -41,7 +41,7 @@ declare global {
/** /**
* *
*/ */
value: number; value: string;
/** /**
* *
*/ */

View File

@ -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>

View File

@ -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%;