-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navbar.item :current not working with livewire lazy #685
Comments
Can you please check your formatting? It's incredibly difficult to read at the moment. |
Sorry about that, i tried a few times, github just wont comply! |
@thierroboto If you could try to include your code blocks by using 3 backticks instead of 1. e.g. 3 backticks on a line by themselves ...code... 3 backticks on a line by themselves It should format better. |
Thanks for the tip! Done. Much better now. |
@thierroboto the problem will be that the lazy component will have a route of So you need to ensure the sidebar is rendered on initial load for it to be the correct route when it is rendered. I would just defer the count by wrapping the query in a boolean, instead of making the whole sidebar lazy, then once rendered use |
Hi,
In my menu, I have one navbar item that has a badge that is a count of posts. In order to prevent the count from slowing down the menu, i made a livewire component with that item and set it as lazy.
With the same code in the livewire component, the "current" doesn't work and doesnt give it an active background.
The code without livewire that works:
The livewire blade component (tried it without the current parameter also):
The livewire component code:
The text was updated successfully, but these errors were encountered: