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

:bug: 修复异步组件渲染数据表单弹窗按钮点击无效问题

jqh 5 лет назад
Родитель
Сommit
3f78c35f06
1 измененных файлов с 7 добавлено и 16 удалено
  1. 7 16
      src/Widgets/DialogForm.php

+ 7 - 16
src/Widgets/DialogForm.php

@@ -45,8 +45,6 @@ class DialogForm
         $this->title($title);
         $this->title($title);
 
 
         $this->url($url);
         $this->url($url);
-
-        $this->autoRender();
     }
     }
 
 
     /**
     /**
@@ -254,20 +252,6 @@ JS
         );
         );
     }
     }
 
 
-    /**
-     * 自动渲染.
-     *
-     * @return void
-     */
-    protected function autoRender()
-    {
-        Content::composed(function () {
-            if ($results = Helper::render($this->render())) {
-                Admin::html($results);
-            }
-        });
-    }
-
     /**
     /**
      * 配置选项初始化.
      * 配置选项初始化.
      *
      *
@@ -335,4 +319,11 @@ Dcat.FormConfirm = {$confirm};
 JS
 JS
         );
         );
     }
     }
+
+    public function __destruct()
+    {
+        if ($results = Helper::render($this->render())) {
+            Admin::html($results);
+        }
+    }
 }
 }