Browse Source

支持设置组件的 style #42

xaboy 6 years ago
parent
commit
dcf2226ec1
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/Rule/PropsRule.php

+ 3 - 0
src/Rule/PropsRule.php

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