Ver Fonte

fix: missing the default required label style for components such as select (#4444)

* fix: hover border style same as antd style when validate error

* fix: hover border style same as antd style when validate error

* feat(@vben-core/form-ui): Default form validation rules applicable to selector components

* fix: Missing the default required label style for components such as select
LinaBell há 6 meses atrás
pai
commit
b12ff2d766

+ 1 - 1
packages/@core/ui-kit/form-ui/src/form-render/form-field.vue

@@ -95,7 +95,7 @@ const shouldRequired = computed(() => {
   }
 
   if (isString(currentRules.value)) {
-    return currentRules.value === 'required';
+    return ['required', 'selectRequired'].includes(currentRules.value);
   }
 
   let isOptional = currentRules?.value?.isOptional?.();