From be857d0f454308230dfb84f11c0a31cdf60cddc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 6 Apr 2021 19:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96checkbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/checkbox-item.wc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/form/checkbox-item.wc b/src/form/checkbox-item.wc index b3182ed..463f66c 100644 --- a/src/form/checkbox-item.wc +++ b/src/form/checkbox-item.wc @@ -77,11 +77,11 @@ :host([type='info']) label { color: var(--color-blue-1); .dot { - border-color: var(--color-bule-1); + border-color: var(--color-blue-1); } &.checked .dot { - background: var(--color-bule-1); + background: var(--color-blue-1); } } :host([type='info']:focus-within) .dot { @@ -152,7 +152,6 @@ import $ from '../utils' export default class Checkbox { props = { - color: '', value: '', checked: false, readonly: false, @@ -190,15 +189,7 @@ export default class Checkbox { set checked(val) { this.props.checked = !!val - var { checked, color } = this.props - this.__SWITCH__.classList.toggle('checked', checked) - this.__ICO__.setAttribute('is', 'checkbox-' + (checked ? 'on' : 'off')) - - if (checked) { - this.__ICO__.setAttribute('color', color) - } else { - this.__ICO__.removeAttribute('color') - } + this.__SWITCH__.classList.toggle('checked', this.props.checked) } get readOnly() { @@ -282,7 +273,6 @@ export default class Checkbox { watch() { switch (name) { case 'value': - case 'color': this.props[name] = val break