$js actions for tabs #1966
mauritskorse
started this conversation in
Showcase
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have created various $js actions for
<flux:tabs>. You can find the gist here: https://gist.github.com/mauritskorse/75817b2297669cfe73146a4252ed6295Switch optimistically to a tab before wire:model makes the round trip
These actions can be used from within and outside the tab group using
wire:clickswitchTab()nextTab()previousTab()firstTab()lastTab()Example
Force loading a lazy livewire component witin a tab when hovering the tab:
This action can be used if your tabpanel has a lazy livewire component inside. It will force to load the component when the user enters the tab when adding
x-on:mouseenter="$js.loadLazyTab($el)"toyour<flux:tab>. The load will be triggered after 100ms or cancelled when the user has moved out again.loadLazyTab($el)Example
Note: Unfortunately you need to pass
$elto the action as Alpine doesn't forward the Event object. Using@mouseenteris not possible on blade components, so you have to usex-on:Beta Was this translation helpful? Give feedback.
All reactions