color input and opacity input now use Checkbox component. Cleanup.

This commit is contained in:
Henry Jameson 2020-01-02 22:44:54 +02:00
parent adbab6ad2a
commit c7e9f21da0
5 changed files with 30 additions and 65 deletions

View file

@ -9,18 +9,12 @@
>
{{ label }}
</label>
<input
v-if="typeof fallback !== 'undefined'"
:id="name + '-o'"
class="opt exlcude-disabled"
type="checkbox"
:checked="present"
@input="$emit('input', typeof value === 'undefined' ? fallback : undefined)"
>
<label
<Checkbox
v-if="typeof fallback !== 'undefined' && showOptionalTickbox"
class="opt-l"
:for="name + '-o'"
:checked="present"
:disabled="disabled"
@change="$emit('input', typeof value === 'undefined' ? fallback : undefined)"
class="opt"
/>
<input
:id="name"
@ -42,6 +36,7 @@
</template>
<script>
import Checkbox from '../checkbox/checkbox.vue'
export default {
props: {
// Name of color, used for identifying
@ -80,6 +75,9 @@ export default {
default: true
}
},
components: {
Checkbox
},
computed: {
present () {
return typeof this.value !== 'undefined'