Added label prop to toggleswitch

This commit is contained in:
Roman Cervantes 2018-11-24 20:47:57 -07:00
parent 3af44f5b27
commit 820d48111f

View file

@ -1,5 +1,7 @@
<template lang="html"> <template lang="html">
<span class="toggle-switch"> <span class="toggle-switch">
<p v-if="label">{{ label }}</p>
<input <input
type="checkbox" type="checkbox"
:id="id" :id="id"
@ -15,6 +17,7 @@ export default {
props: { props: {
value: Boolean, value: Boolean,
id: String, id: String,
label: String,
}, },
data() { data() {
@ -43,6 +46,14 @@ export default {
.toggle-switch { .toggle-switch {
display: inline-flex; display: inline-flex;
p {
margin: 0;
font-size: 12px;
display: flex;
align-items: center;
font-weight: bold;
}
input[type=checkbox]{ input[type=checkbox]{
height: 0; height: 0;
width: 0; width: 0;