laravel livewire 去掉html结束注释

去掉会提示警告:检测到多个根元素
Livewire: Multiple root elements detected. This is not supported.

\vendor\livewire\livewire\src\Features\SupportRootElementTracking.php
public function addComponentEndingMarker($html, $component)
{
    return $html."\n<!-- Livewire Component wire-end:".$component->id.' -->';
}

public static function stripOutEndingMarker($html)
{
    return preg_replace('/<!-- Livewire Component wire-end:.*? -->/', '', $html);
}
相关文章