1.0.1 • Published 4 years ago

@dariustanhai/vue-toggle v1.0.1

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

toggle

VueJS lightweight toggle component

Check out the live DEMO

Installation

$ npm install --save @dariustanhai/vue-toggle

Usage

<template>
  <toggle
    class="toggle"
    left="YES"
    right="NO"
    identifier="toggle"
    :startRight="condition"
    @propagate="setToggle">
  />
</template>

<script>

export default {
  data() {
    return {
      condition: false
    }
  },
  components: {
    toggle: () => import('@dariustanhai/vue-toggle') 
  },
  methods: {
    setToggle () {
      this.condition = !this.condition
    }
  }
}
  
</script>

<style lang="scss">

.toggle {
  margin: 50px auto;
  border: solid black 1px;
  border-radius: 5px;
  @include dimension (240px, 40px);
  .active {
    background-color: red;
  }
  h6 {
    font-family: 'Arial';
  }
}
  
</style>

Props

PropType(s)Description
leftStringLabel for left toggle
rightStringLabel for right toggle
identifierStringUnique ID for multiple toggles
startRightBooleanChange default start location to right toggle

Author

Darius Tanhai

  • Checkout my Freelance Web Developer Portfolio Website
  • Lets Work Together.

License

MIT

1.0.1

4 years ago

1.0.0

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago