Skip to content

Instantly share code, notes, and snippets.

@davidhemphill
Created December 6, 2017 22:50
Show Gist options
  • Save davidhemphill/6dc905bb390cba4abd4d2f21c9a0c375 to your computer and use it in GitHub Desktop.
Save davidhemphill/6dc905bb390cba4abd4d2f21c9a0c375 to your computer and use it in GitHub Desktop.
<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