Apply highlight on false value as well

pull/5/head
cagataycivici 2018-12-16 23:35:33 +03:00
parent 6cdbd0d082
commit 2281caae8b
1 changed files with 2 additions and 5 deletions

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="p-checkbox p-component" @click="onClick($event)"> <div class="p-checkbox p-component" @click="onClick($event)">
<div class="p-hidden-accessible"> <div class="p-hidden-accessible">
<input ref="input" :id="inputId" type="checkbox" :name="name" :checked="checked" :disabled="disabled" @focus="onFocus()" @blur="onBlur()" <input ref="input" :id="inputId" type="checkbox" :name="name" :checked="value === true" :disabled="disabled" @focus="onFocus()" @blur="onBlur()"
:autocomplete="autocomplete" :autofocus="autofocus"> :autocomplete="autocomplete" :autofocus="autofocus">
</div> </div>
<div ref="box" :class="['p-checkbox-box p-component', {'p-highlight': checked, 'p-disabled': disabled, 'p-focus': focused}]"> <div ref="box" :class="['p-checkbox-box p-component', {'p-highlight': (value != null), 'p-disabled': disabled, 'p-focus': focused}]">
<span :class="['p-checkbox-icon p-c', icon]"></span> <span :class="['p-checkbox-icon p-c', icon]"></span>
</div> </div>
</div> </div>
@ -62,9 +62,6 @@ export default {
} }
}, },
computed: { computed: {
checked() {
return this.value === true;
},
icon() { icon() {
let icon; let icon;
switch (this.value) { switch (this.value) {