npm.io
1.0.8 • Published 8 years ago

vb-switch

Licence
MIT
Version
1.0.8
Deps
0
Vulns
0
Weekly
0

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

Keywords