How to create a reusable toggle switch component with Vue.js
What we'd like instead, is to have is a simple <toggle-switch> element we can use throughout our project. Much cleaner!
To do this, we will extract the markup needed for the toggle switch to a reusable Vue component. We will also add a little bit of functionality to the component so that v-model works like with native checkbox input elements, and so that we can set a default checked state .
Let's get started!