Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

rafaberaldo/vue-checkbox-switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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