ソースを参照

支持设置组件的 style #42

xaboy 6 年 前
コミット
dcf2226ec1
1 ファイル変更3 行追加0 行削除
  1. 3 0
      src/Rule/PropsRule.php

+ 3 - 0
src/Rule/PropsRule.php

@@ -30,6 +30,7 @@ trait PropsRule
     protected $attrs = [];
     protected $attrs = [];
 
 
     /**
     /**
+     * 组件的样式
      * @var string|array
      * @var string|array
      */
      */
     protected $style;
     protected $style;
@@ -123,6 +124,8 @@ trait PropsRule
             $rule['attrs'] = $this->attrs;
             $rule['attrs'] = $this->attrs;
         if (count($this->domProps))
         if (count($this->domProps))
             $rule['domProps'] = $this->domProps;
             $rule['domProps'] = $this->domProps;
+        if (!is_null($this->style))
+            $rule['style'] = $this->style;
 
 
         return $rule;
         return $rule;
     }
     }