浏览代码

col 方法支持数字

xaboy 6 年之前
父节点
当前提交
56b1f52fda
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Rule/BaseRule.php

+ 2 - 1
src/Rule/BaseRule.php

@@ -169,11 +169,12 @@ trait BaseRule
     }
 
     /**
-     * @param array|ColComponentInterface $col
+     * @param array|int|ColComponentInterface $col
      * @return $this
      */
     public function col($col)
     {
+        if(is_integer($col)) $col = ['span'=>$col];
         $this->col = $col;
         return $this;
     }