Skip to content
A Vue component for checkbox's switch style
Branch: master
Clone or download
Latest commit e757df1 Jun 16, 2017
Permalink
Type Name Latest commit message Commit time
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

You can’t perform that action at this time.