Giter VIP home page Giter VIP logo

Comments (4)

PH7-Jack avatar PH7-Jack commented on May 17, 2024

Hello @kevyworks

You can show spinner loading when any or specific livewire action is fired, see the examples

Consider these examples inside a livewire component

It will show a loading spinner when any request is fired
<x-button label="Save" spinner />
It will show a loading spinner only when the delete method is fired
<x-button label="Delete" spinner="delete" />

Note: if the spinner is passed without value, any requests will show a loading spinner
Note: This spinner works using a livewire loading state, so, you must have the livewire styles @livewireStyles or <livewire:styles /> in your layout

from wireui.

kevyworks avatar kevyworks commented on May 17, 2024

@PH7-Jack Thanks, I added @livewireStyles and recompiled and it works.. Please do note this on Installation instruction as well. Appreciate your help! thanks!

from wireui.

kevyworks avatar kevyworks commented on May 17, 2024

@PH7-Jack By the way, I have a custom component without a Component Class, Is there a way to trigger spinner if this component was loaded via BladeCompiler::component('x-form', 'components.form') ?

<x-form action="{{ route('verify-email') }}">
    <x-button outline primary spinner type="submit" label="{{ __('Resend Verification Email') }}" />
</x-form>

Above seems not working with spinner. Any hacks for this?

from wireui.

PH7-Jack avatar PH7-Jack commented on May 17, 2024

This spinner works only inside a livewire component, if you have a form blade component, and the button is inside this form, will work. Otherwise, you need create a custom component to works using ajax

from wireui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.