0.1.3 • Published 4 years ago

await-button v0.1.3

Weekly downloads
14
License
-
Repository
github
Last release
4 years ago

await-button

await-buttons is a super simple module that add a loading indicator to a button of when you process a promose or await code. Check out the demo!

Getting started

Install it via npm:

npm i await-button -S

Usage

<AwaitButton @click="handleBtnClick">Click me</AwaitButton>
import AwaitButton from 'await-button'
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  components: {
    AwaitButton
  },
  methods: {
    handleBtnClick () {
      return new Promise((resolve) => {
        setTimeout(() => {
          resolve()
        }, 1000)
      })
    }
  }
}