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

Latest commit

 

History

History
44 lines (33 loc) · 1.01 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.01 KB

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