Просмотр исходного кода

添加:Form表单底部可设置‘查看’,‘继续编辑’,‘继续创建’等按钮默认勾选。

ving 4 лет назад
Родитель
Сommit
e4aa33a024
2 измененных файлов с 39 добавлено и 3 удалено
  1. 36 0
      src/Form.php
  2. 3 3
      src/Form/Footer.php

+ 36 - 0
src/Form.php

@@ -1505,6 +1505,42 @@ class Form implements Renderable
         return $this;
     }
 
+    /**
+     * default View Checked on footer.
+     *
+     * @return $this
+     */
+    public function defaultViewChecked(bool $checked = true)
+    {
+        $this->builder->footer()->defaultViewChecked($checked);
+
+        return $this;
+    }
+
+    /**
+     * default Editing Checked on footer.
+     *
+     * @return $this
+     */
+    public function defaultEditingChecked(bool $checked = true)
+    {
+        $this->builder->footer()->defaultEditingChecked($checked);
+
+        return $this;
+    }
+
+    /**
+     * default Creating Checked on footer.
+     *
+     * @return $this
+     */
+    public function defaultCreatingChecked(bool $checked = true)
+    {
+        $this->builder->footer()->defaultCreatingChecked($checked);
+
+        return $this;
+    }
+
     /**
      * Disable `view` tool.
      *

+ 3 - 3
src/Form/Footer.php

@@ -136,7 +136,7 @@ class Footer implements Renderable
      *
      * @return $this
      */
-    public function defaultViewChecked(bool $checked = false)
+    public function defaultViewChecked(bool $checked = true)
     {
         $this->defaultcheckeds['view'] = $checked;
 
@@ -150,7 +150,7 @@ class Footer implements Renderable
      *
      * @return $this
      */
-    public function defaultEditingChecked(bool $checked = false)
+    public function defaultEditingChecked(bool $checked = true)
     {
         $this->defaultcheckeds['continue_editing'] = $checked;
 
@@ -164,7 +164,7 @@ class Footer implements Renderable
      *
      * @return $this
      */
-    public function defaultCreatingChecked(bool $checked = false)
+    public function defaultCreatingChecked(bool $checked = true)
     {
         $this->defaultcheckeds['continue_creating'] = $checked;