diff --git a/src/Fasim/Widget/Form.php b/src/Fasim/Widget/Form.php index aecdfa1..5be47b0 100644 --- a/src/Fasim/Widget/Form.php +++ b/src/Fasim/Widget/Form.php @@ -513,11 +513,16 @@ public function renderInput() { class FormImages extends FormGroup { public $maxCount = 6; + public $allowFiles = 'jpg,jpeg,gif,png'; public function maxCount($maxCount) { $this->maxCount = $maxCount; } + public function allowFiles($allowFiles) { + $this->allowFiles = $allowFiles; + } + public function renderInput() { $fileId = 'i_'.$this->key; @@ -543,7 +548,7 @@ public function renderInput() { pick: '#{$filePickerId}', accept: { title: '上传文件', - extensions: '{$this->allowFiles}, + extensions: '{$this->allowFiles}', mimeTypes: 'image/*' } });