Lazy-load the tree view component

This commit is contained in:
Bruno
2024-12-09 19:14:51 +00:00
parent eae858869a
commit fb8641b45e
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -17,6 +17,17 @@ class TreeView extends Component
public $showEditModal = false;
public function placeholder(): string
{
return <<<'HTML'
<div class="fixed inset-0 z-40 opacity-50 bg-light-base-200 dark:bg-base-950">
<div class="flex items-center justify-center h-full">
<x-icons.spinner class="w-5 h-5 animate-spin" />
</div>
</div>
HTML;
}
public function render()
{
$constraint = function ($query) {
@@ -87,7 +87,7 @@
</div>
</div>
<livewire:vault.tree-view :$vault />
<livewire:vault.tree-view lazy="on-load" :$vault />
</div>
<div class="absolute top-0 bottom-0 right-0 flex flex-col w-full overflow-y-auto transition-all text-start md:pl-60"