Created
December 6, 2017 22:50
-
-
Save davidhemphill/6dc905bb390cba4abd4d2f21c9a0c375 to your computer and use it in GitHub Desktop.
This file contains 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
<script> | |
export default { | |
props: ['label', 'checked'], | |
data() { | |
return { | |
classes: { | |
'checkbox-input-active': this.checked | |
}, | |
} | |
}, | |
methods: { | |
onChange(event) { | |
this.$emit('change', this.$refs.boxOfCheck.checked) | |
}, | |
}, | |
} | |
</script> | |
<template> | |
<label class="checkbox df aic acc" :class="{'checkbox-input-active' : checked}"> | |
<span class="checkbox-input bgshadow--out"> | |
<span class="checkbox-input-inner :bc1 ::bc1 @bc1 ft4 tcg50"></span> | |
<input ref="boxOfCheck" :checked="checked" @change="onChange" type="checkbox" class="checkbox-input-original" | |
:class="classes"> | |
</span> | |
<span class="ml1 ft4 tcg50">{{ label }}</span> | |
</label> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment