Vue
Switch branches/tags
Nothing to show
Latest commit e757df1 Jun 16, 2017 @rafaelpimpa rafaelpimpa Merge pull request #2 from mgrybyk/master
watch checked changes
Permalink
Failed to load latest commit information.
src watch checked changes Jun 14, 2017
LICENSE Initial commit Mar 8, 2017
README.md Update README.md May 3, 2017
package.json Switch Mar 8, 2017
screenshot.png Add files via upload Mar 8, 2017

README.md

Vue Checkbox Switch

A simple Vue component for checkbox's switch style based on vue-bulma/switch and this PR on Bulma

Installation

You don't need any dependencies except Vuejs 2

Copy src/Switch.vue to your components folder

Example

Screenshot

<template>
    <app-switch classes="is-warning" v-model="value" checked>Test</app-switch>
</template>

<script>
    import Switch from './components/Switch'

    export default {
        components: {
            'app-switch': Switch
        },
        data() {
            return {
                value: false,
                text: ''
            }
        },
        watch: {
            value(val) {
                this.text = val ? 'Yes' : 'No'
            }
        }
    }
</script>

Twitter @rafaelpimpa