This commit is contained in:
icssoa
2025-08-06 19:44:19 +08:00
parent fd8ff27fb0
commit efadda53d9
2 changed files with 6 additions and 3 deletions

View File

@@ -50,6 +50,10 @@ defineOptions({
name: "cl-form-item"
});
defineSlots<{
error(props: { error: string }): any;
}>();
// 组件属性定义
const props = defineProps({
// 透传样式
@@ -172,9 +176,9 @@ onMounted(() => {
return value;
}),
(val: any, val2: any) => {
(a: any, b: any) => {
if (props.required) {
if (!isEqual(val, val2)) {
if (!isEqual(a, b)) {
validateField(props.prop);
}
}

View File

@@ -172,7 +172,6 @@ declare type ClFormComponentPublicInstance = {
addField: (prop: string) => void;
removeField: (prop: string) => void;
getValue: (prop: string) => any | null;
setData: (data: UTSJSONObject) => void;
setError: (prop: string, error: string) => void;
getError: (prop: string) => string;
removeError: (prop: string) => void;