Skip to content

Commit 761147c

Browse files
committed
v3.4
1 parent 309a818 commit 761147c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Widget/Linear.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,21 @@ public function render()
4343
* 直接调用Linear组件
4444
* @param array $columns 头部字段样式定义
4545
* @param array $data 数据集
46+
* @param array $style 组件样式设置 宽:width 高:height
4647
* @param array $options 操作列设置
4748
* options.sortable bool 可排序
4849
* options.delete bool 可删除
4950
* @return string
5051
*/
51-
public static function panel(array $columns,array $data,array $options=['sortable' => true, 'delete' => true])
52+
public static function panel(array $columns,array $data,array $style=[],array $options=['sortable' => true, 'delete' => true])
5253
{
5354
$columns = json_encode($columns, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
5455
$data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
56+
$style = array_merge(['width'=>'100%','height'=>'355px'],$style);
57+
$style_string = '';
58+
foreach ($style as $k=>$s){
59+
$style_string.="$k:$s;";
60+
}
5561
$options = json_encode(array_merge(['sortable' => true, 'delete' => true],$options));
5662
$id = 'linear_'.mt_rand(0,100);
5763
return <<<EOF

0 commit comments

Comments
 (0)