Skip to content

Event support on Bridge component #433

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

Merged
merged 4 commits into from
Jun 14, 2023
Merged

Conversation

bdsumon4u
Copy link
Contributor

Please allow me to use events on Bridge component, @pascalbaljet.

<x-frontend.add-to-cart :product="$product" @success="$splade.emit('added-to-cart')" />

Here AddToCart component is a Bridge component. I want to rehydrate another fragment of code when one product is added to the cart.

<x-splade-rehydrate on="added-to-cart">
    <a href="#" class="relative text-center text-gray-700 transition hover:text-primary">
        ...
        <div class="text-xs leading-3">Cart</div>
        <div class="absolute flex items-center justify-center ...">{{ \LaraCart::count() }}</div>
    </a>
</x-splade-rehydrate>

@pascalbaljet
Copy link
Contributor

Thanks!

@pascalbaljet pascalbaljet merged commit 80e3f16 into protonemedia:main Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants