npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bt-vue-button

v1.1.3

Published

VueJS button plugin for bootstrap framework to show action in progress and avoid double click.

Downloads

52

Readme

Build Status Coverage Status Known Vulnerabilities

Installation

npm i bt-vue-button --save

Getting Started

Import component Globally

Inside main.js

import Vue from 'vue'
import App from './App.vue'
import btVueButton from 'bt-vue-button'

Vue.use(btVueButton)

new Vue({
  render: h => h(App),
}).$mount('#app')

Inside your component

<btVueButtonTest></btVueButtonTest>

Import component inside individual component

Inside HelloWorld.vue

<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <btVueButtonTest></btVueButtonTest>
  </div>
</template>

<script>
import btVueButton from 'bt-vue-button'
export default {
  name: 'HelloWorld',
  components: { btVueButton },
  props: {
    msg: String
  }
}
</script>

<style scoped>
</style>

Props

  • btnName: Sets name (String) of the button, default value is btnVueButton-name.
  • btnId: Sets id (String) of the button, default value is btnVueButton-Id.
  • btnClass: Sets classe/s (String) for button, default value is null.
  • btnValue: Sets value (String) from button, default value is Submit.
  • btnDisabled: Sets button as disabled (Boolean), default value is false.
  • btnFinalState: Sets final state (String) of button after button is pressed, default value is null. Allowed values are success, failure or ''
  • actionInProgress: Sets if currently an action is in progress or not, default value is false.

Events

clicked event is emitted to each time button is pressed. actionInProgress event is emitted after btnFinalState visual representation process is completed.

How to use events and props in Parent

  • In parent component define 3 data values
data() {
        return {
            actionInProgress: null,
            isDisabled: null,
            finalState: null
        }
    }
  • In parent template section add btVueButton template
<btVueButton v-on:clicked="someAction()"
            :actionInProgress.sync="actionInProgress"
            :isDisabled="isDisabled"
            :btnFinalState="finalState">
            <template #inProgress>
              <span class="spinner-grow spinner-grow-sm" role="status" aria-hidden="true"></span>
            </template>
</btVueButton>
  • Now define someAction methods
methods: {
        someAction() {
            this.actionInProgress=true

            // some validation failure
            // setTimeout(()=>{
            //     this.actionInProgress=false
            // }, 2000)

            // validation passed and some axios call made
            // if success result
            //this.finalState = 'success'

            // if success failed
            //this.finalState = 'failure'

        }
    }