xaboy 6 年 前
コミット
ced1a8c2ae
2 ファイル変更5 行追加3 行削除
  1. 1 1
      src/factory/Elm.php
  2. 4 2
      src/rule/BaseRule.php

+ 1 - 1
src/factory/Elm.php

@@ -86,7 +86,7 @@ abstract class Elm
      *
      *
      * @return Popover
      * @return Popover
      */
      */
-    public static function poptip()
+    public static function popover()
     {
     {
         return new Popover();
         return new Popover();
     }
     }

+ 4 - 2
src/rule/BaseRule.php

@@ -242,11 +242,13 @@ trait BaseRule
     protected function parseBaseRule()
     protected function parseBaseRule()
     {
     {
         $rule = [
         $rule = [
-            'value' => $this->value,
-            'field' => $this->field,
             'type' => $this->type
             'type' => $this->type
         ];
         ];
 
 
+        if (!is_null($this->field))
+            $rule['field'] = $this->field;
+        if (!is_null($this->value))
+            $rule['value'] = $this->value;
         if (!is_null($this->title))
         if (!is_null($this->title))
             $rule['title'] = $this->title;
             $rule['title'] = $this->title;
         if (!is_null($this->className))
         if (!is_null($this->className))