jqh 4 years ago
parent
commit
e49c1081e9
3 changed files with 2 additions and 12 deletions
  1. 0 7
      src/Grid/Concerns/HasExporter.php
  2. 1 1
      src/Show.php
  3. 1 4
      src/Show/Html.php

+ 0 - 7
src/Grid/Concerns/HasExporter.php

@@ -81,7 +81,6 @@ trait HasExporter
         }
 
         if ($forceExport || $this->allowExporter()) {
-
             return $this->resolveExportDriver($scope)->export();
         }
     }
@@ -91,12 +90,6 @@ trait HasExporter
      */
     public function exporter()
     {
-//        if (! $this->exporter) {
-//            $this->exporter = new Exporter($this);
-//
-//            $this->setExporterQueryName();
-//        }
-
         return $this->exporter ?: ($this->exporter = new Exporter($this));
     }
 

+ 1 - 1
src/Show.php

@@ -518,7 +518,7 @@ class Show implements Renderable
      */
     public function html($html = '')
     {
-        $this->fields->push(new Html($html, $this));
+        $this->fields->push((new Html($html))->setParent($this));
     }
 
     /**

+ 1 - 4
src/Show/Html.php

@@ -3,17 +3,14 @@
 namespace Dcat\Admin\Show;
 
 use Dcat\Admin\Support\Helper;
-use Dcat\Admin\Show;
 
 class Html extends Field
 {
     public $html;
 
-    public function __construct($html, Show $show, string $name = '', string $label = '')
+    public function __construct($html)
     {
-        parent::__construct($name, $label);
         $this->html = $html;
-        $this->setParent($show);
     }
 
     public function render()