Coder Social home page Coder Social logo

vue-ladda's Introduction

vue-ladda

A vue wrapper for https://github.com/hakimel/Ladda .

Demo

Demo source code

Installation

Direct Download / CDN

https://unpkg.com/vue-ladda/dist/vue-ladda.js

<script src="https://unpkg.com/vue-ladda"></script>

Then you can use it in this way:

<vue-ladda ...>...</vue-ladda>

NPM

npm install vue-ladda
import VueLadda from 'vue-ladda'

// or import the vue single file component, if you set vue-loader, sass-loader and babel properly.
import VueLadda from 'vue-ladda/src/vue-ladda.vue'

// then register it globally
Vue.component('vue-ladda', VueLadda)

// or locally
var Child = {
  template: '<vue-ladda>Click Me!</vue-ladda>'
}
new Vue({
  // ...
  components: {
    // <my-component> will only be available in parent's template
    'vue-ladda': VueLadda
  }
})

How to use

  • Use default slot to give button label: (Default label is "Submit")

    <vue-ladda>Confirm</vue-ladda>
  • Use buttonClass prop to specify your own CSS classes: (Default is "ladda-class") ie. you can use Bootstrap button classes

    <vue-ladda button-class="btn btn-primary">Yes!</vue-ladda>
  • Use data-style prop to specify animation:

    <vue-ladda data-style="expand-left|contract|zoom-in|slide-left">
      ...
    </vue-ladda>

    Visit http://lab.hakim.se/ladda/ to get a full options of data-style.

  • Use loading prop to control button status:

    <vue-ladda loading="true|false">...</vue-ladda>
  • Use progress prop to control the ladda built-in progress bar. (0 to 1)

    <vue-ladda :progress="0-1">...</vue-ladda>

vue-ladda's People

Contributors

alexwijn avatar dependabot[bot] avatar zcfan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-ladda's Issues

@click event not available?

Just wondering why @click event does nothing. Isn't this event available for ladda-btn?

<ladda-btn
      type="button"
      :loading="saving"
      data-style="zoom-out"
      class="btn btn-primary"
      @click="save()">Guardar
</ladda-btn>

:disabled not working on loading

Hi!

I'm facing an issue when loading the page, the :disabled attribute doesnt take the value of the computed property I'm passing it.

Any idea how to fix it?

Thanks!

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.