self::TYPE_INPUT, 'maxLength' => 0 ]; protected static $propsRule = [ 'type' => 'string', 'src' => 'string', 'maxLength' => 'int', 'icon' => 'string', 'height' => 'string', 'width' => 'string', 'spin' => 'boolean', 'frameTitle' => ['string', 'title'], 'handleIcon' => 'boolean', 'allowRemove' => 'boolean', ]; protected function init() { $this->frameTitle('请选择' . $this->title); } public function build() { $value = $this->value; if ($this->props['maxLength'] == 1) $value = is_array($value) && isset($value[0]) ? $value[0] : ''; return [ 'type' => $this->name, 'field' => $this->field, 'title' => $this->title, 'value' => $value, 'props' => (object)$this->props, 'validate' => $this->validate ]; } }