Эх сурвалжийг харах

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

jqh 5 жил өмнө
parent
commit
3f78c35f06

+ 7 - 16
src/Widgets/DialogForm.php

@@ -45,8 +45,6 @@ class DialogForm
         $this->title($title);
 
         $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
         );
     }
+
+    public function __destruct()
+    {
+        if ($results = Helper::render($this->render())) {
+            Admin::html($results);
+        }
+    }
 }