Browse Source

新增 effect 配置项

xaboy 4 years ago
parent
commit
a171c3943d
1 changed files with 18 additions and 0 deletions
  1. 18 0
      src/Rule/BaseRule.php

+ 18 - 0
src/Rule/BaseRule.php

@@ -103,6 +103,11 @@ trait BaseRule
     protected $visibility;
 
     /**
+     * @var array
+     */
+    protected $effect;
+
+    /**
      * 组件显示状态
      *
      * @param bool $hidden
@@ -217,6 +222,12 @@ trait BaseRule
         return $this;
     }
 
+    public function effect(array $effect)
+    {
+        $this->effect = $effect;
+        return $this;
+    }
+
     /**
      * @param mixed $value
      * @return $this
@@ -278,6 +289,11 @@ trait BaseRule
         return $this->col;
     }
 
+    public function getEffect()
+    {
+        return $this->effect;
+    }
+
     public function getValue()
     {
         return $this->value;
@@ -308,6 +324,8 @@ trait BaseRule
             $rule['native'] = $this->native;
         if (!is_null($this->info))
             $rule['info'] = $this->info;
+        if (!is_null($this->effect))
+            $rule['effect'] = $this->effect;
         if (!is_null($this->inject))
             $rule['inject'] = $this->inject;
         if (!is_null($this->hidden))