Last active
July 8, 2019 10:25
-
-
Save SteinRobert/e6510fe2dbf71e17113e1af33dd6eef4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <input type="checkbox" :name="name" :id="id" :checked="active"> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| name: 'Toggle', | |
| props: { | |
| name: { | |
| type: String, | |
| default: '' | |
| }, | |
| id: { | |
| type: String, | |
| default: () => { | |
| // Taken from https://gist.github.com/gordonbrander/2230317 | |
| return 'toggle-' + Math.random().toString(36).substr(2, 9); | |
| } | |
| }, | |
| active: { | |
| type: Boolean, | |
| default: false | |
| } | |
| } | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment