Kaynağa Gözat

优化 规范多语言组件代码, 消除在输入框无内容时,浏览器控制台报警告

夜鹰 7 ay önce
ebeveyn
işleme
5d507a6019

+ 3 - 3
Web/src/components/multiLangInput/index.vue

@@ -37,7 +37,7 @@ import { Local } from '/@/utils/storage';
 import { getAPI } from '/@/utils/axios-utils';
 import { getAPI } from '/@/utils/axios-utils';
 import { SysLangTextApi } from '/@/api-services/api';
 import { SysLangTextApi } from '/@/api-services/api';
 import { ElMessage } from 'element-plus';
 import { ElMessage } from 'element-plus';
-const emit = defineEmits<{ (e: 'update:modelValue', value: string): void; }>();
+const emit = defineEmits<{ (e: 'update:modelValue', value?: string | null): void; }>();
 const ruleFormRef = ref();
 const ruleFormRef = ref();
 
 
 const fetchMultiLang = async () => {    
 const fetchMultiLang = async () => {    
@@ -51,7 +51,7 @@ const inputModelValue = computed({
 });
 });
 
 
 const props = defineProps<{
 const props = defineProps<{
-    modelValue: string;
+    modelValue?: string | null;
     entityName: string;
     entityName: string;
     entityId: number;
     entityId: number;
     fieldName: string;
     fieldName: string;
@@ -69,7 +69,7 @@ const activeLang = ref('zh-CN');
 const dialogVisible = ref(false);
 const dialogVisible = ref(false);
 
 
 // 多语言对象
 // 多语言对象
-const multiLangValue = ref<Record<string, string>>({});
+const multiLangValue = ref<Record<string, string | null | undefined>>({});
 
 
 // 当前语言显示 Label
 // 当前语言显示 Label
 const currentLangLabel = computed(() => {
 const currentLangLabel = computed(() => {

+ 1 - 1
Web/src/views/system/menu/component/editMenu.vue

@@ -155,7 +155,7 @@ const state = reactive({
 	ruleForm: {} as UpdateMenuInput,
 	ruleForm: {} as UpdateMenuInput,
 });
 });
 // 级联选择器配置选项
 // 级联选择器配置选项
-const cascaderProps = { checkStrictly: true, emitPath: false, value: 'id', label: 'title' };
+const cascaderProps = { checkOnClickNode: true, checkStrictly: true, emitPath: false, value: 'id', label: 'title' };
 
 
 // 获取全局组件大小
 // 获取全局组件大小
 const getGlobalComponentSize = computed(() => {
 const getGlobalComponentSize = computed(() => {