Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-promise-button

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-promise-button

A promise button for vuejs, handles buttons asynchronous lock and show loading state indicator

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

vue-promise-button

Installation

npm install vue-promise-button
or
yarn add vue-promise-button

Usage

import PromiseButton from 'vue-promise-button';

// For typescript users
import PromiseButton from 'vue-promise-button/src/components/PromiseButton.vue'

// Set global if you want
Vue.component('promise-button', PromiseButton);

// Use it
<promise-button class="button" :promise="promise">
I'm a promise button
</promise-button>

Setup your promise function as a promise like this.

export default {
  methods: {
    promise() {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve(true)
        }, 2000)
      })
    }
  }
}

With axios and api

export default {
  methods: {
    promise() {
      return axios.get('/users/1234')
    }
  }
}

Development

yarn install

Compiles and hot-reloads for development

yarn run serve

Compiles and minifies for production

yarn run build

Run your tests

yarn run test

Lints and fixes files

yarn run lint

Run your unit tests

yarn run test:unit

Customize configuration

See Configuration Reference.

Keywords

FAQs

Package last updated on 13 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc