Skip to content

Commit

Permalink
feat: индикация клика по чекбоксу колонки
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Dec 8, 2018
1 parent 6cc0b4e commit 103f1b7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions components/ColumnField.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
<template>
<div class="available-fields__field"
<div class="available-fields__field" ref="component"
:title="field.name + (field.comment ? ` \n${field.comment}` : '') + (field.command ? ` \n${field.command}` : '')"
@click="$emit('click', field)"
@click="click"
>
<input type="checkbox" :checked="checked">
<label>{{ field.comment || field.title }}</label>
</div>
</template>

<style lang="scss">
.available-fields__field{
&.clicked { background: #ffffaa;}
}
</style>

<script>
export default {
props: ['field', 'checked']
props: ['field', 'checked'],
methods: {
click() {
this.$refs.component.classList.add('clicked');
this.$emit('click', this.field);
}
}
}
</script>

0 comments on commit 103f1b7

Please sign in to comment.