Browse Source

fix Elm Upload 组件验证问题

xaboy 5 years ago
parent
commit
c5da370283
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/UI/Elm/Components/Upload.php
  2. 1 1
      src/UI/Iview/Components/Upload.php

+ 1 - 1
src/UI/Elm/Components/Upload.php

@@ -101,6 +101,6 @@ class Upload extends FormComponent
 
     public function createValidate()
     {
-        return Elm::validateArr();
+        return $this->props['limit'] == 1 ? Elm::validateStr() : Elm::validateArr();
     }
 }

+ 1 - 1
src/UI/Iview/Components/Upload.php

@@ -114,6 +114,6 @@ class Upload extends FormComponent
 
     public function createValidate()
     {
-        return Iview::validateArr();
+        return $this->props['maxLength'] == 1 ? Iview::validateStr() : Iview::validateArr();
     }
 }