xaboy 6 years ago
parent
commit
ced1a8c2ae
2 changed files with 5 additions and 3 deletions
  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
      */
-    public static function poptip()
+    public static function popover()
     {
         return new Popover();
     }

+ 4 - 2
src/rule/BaseRule.php

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