v-toggle
a simple a simple toggle component for Vue 2.x.x
design from here
Demo in codepen
Usage
- Install from npm
npm install v-toggle
If you are using plain html you can use the umd version from here
- Include as a component in your app
; name: 'my-component' { return toggleValue: true ; } components: vToggle // window.vToggle.default for umd version ;
- Include the component in your template, do not forget the id and v-model property!
- That's it! Now you have a simple toggle in your app! 😏
Build Setup
# install dependenciesnpm install# serve with hot reload at localhost:8080npm run dev# build for production with minificationnpm run component