vue-bootstrap-toggler-with-input

0.0.4 • Public • Published

Vue Bootstrap Toggler

A simple Vue.js component to add a bootstrap style toggle. Using Vue data bindings to handle class changes and removing the need for jQuery dependency. This is based on the styles in Bootstrap Toggle.

Requirements

Installation

Install with npm

npm install --save-dev vue-bootstrap-toggler-with-input

Full example

<template>
    <div>
        <vue-bootstrap-toggler :options="{ on: 'Yiss', off: 'Nah' }" :disabled="false" @update="updatedValue" 
        name="input_name"
        initial-value="toggleValue"></vue-bootstrap-toggler>
    </div>
</template>

<script>
    import vueBootstrapToggler from 'vue-bootstrap-toggler-with-input';

    export default {
        name: "YourComponentName",

        components: {
            vueBootstrapToggler
        },

        data() {
            return {
                toggleValue: true
            }
        },

        methods: {
            updatedValue(val) {
                this.toggleValue = val;
            }
        }
    }


Package Sidebar

Install

npm i vue-bootstrap-toggler-with-input

Weekly Downloads

1

Version

0.0.4

License

ISC

Unpacked Size

50.5 kB

Total Files

7

Last publish

Collaborators

  • saeed.sajadi