配置说明:
| 参数 | 类型 | 必须 | 默认 | 说明 |
|---|---|---|---|---|
| type | string | Y | 固定值:rate | |
| grid | Array | N | 栅格布局 | |
| name | string | Y | 字段名称 | |
| title | string | Y | 标题 | |
| value | int | N | 定义默认值 | |
| tips | string | N | 提示说明 | |
| attrs | array | N | 自定义属性 | |
| attrs[‘data-options’][‘length’] | int | N | 5 | 评分组件中具体星星的个数 |
| attrs[‘data-options’][‘theme’] | string | N | #FFB800 | 主题颜色 |
| attrs[‘data-options’][‘half’] | bool | N | false | 是否可以选择半星 |
| attrs[‘data-options’][‘text’] | bool | N | false | 是否显示评分对应的内容 |
| attrs[‘data-options’][‘readonly’] | bool | N | false | 是否仅用于展示而不可点 |
示例代码:
public function demo(){$assign['buildForm']['items'] = [['type' => 'rate','title' => '服务评分','name' => 'rate','value' => 3,'attrs' => ['data-options' => ['half' => true,],],],// 更多表单项.....];return $this->assign($assign)->fetch();}
渲染效果:

