vb-switch

1.0.8 • Public • Published

Switch

Switch component for Vue Bulma.

Installation

$ npm install vb-switch --save

Examples

<template>
  <div>
    <p>
      <vb-switch type="success" size="large" checked v-model="value"></vb-switch>
    </p>
    <p>
      {{ text }}
    </p>
  </div>
</template>
 
<script>
// do not use below code, because `Switch` is svg tag.
// import Switch from 'vue-bulma-switch'
import VbSwitch from 'vue-bulma-switch'
 
export default {
  components: {
    VbSwitch
  },
 
  data () {
    return {
      value: false,
      text: ''
    }
  },
 
  watch: {
    value (val) {
      this.text = val ? 'Right' : 'Wrong'
    }
  }
}
</script>

Badges


fundon.me  ·  GitHub @fundon  ·  Twitter @_fundon

Package Sidebar

Install

npm i vb-switch

Weekly Downloads

0

Version

1.0.8

License

MIT

Last publish

Collaborators

  • suyanlu