This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0

优化样式

old
宇天 2019-07-25 22:34:01 +08:00
parent d7bde43d53
commit 0e1776cf90
4 changed files with 26 additions and 29 deletions

View File

@ -39,8 +39,7 @@
} }
.icon { .icon {
width: 18px; --size: 18px;
height: 18px;
margin-right: 3px; margin-right: 3px;
} }
} }
@ -65,8 +64,7 @@
font-size: 16px; font-size: 16px;
} }
.icon { .icon {
width: 20px; --size: 20px;
height: 20px;
} }
} }
:host([size='large'][circle]) { :host([size='large'][circle]) {
@ -78,11 +76,6 @@
button { button {
min-width: 90px; min-width: 90px;
height: 36px; height: 36px;
font-size: 14px;
}
.icon {
width: 18px;
height: 18px;
} }
} }
:host([size='medium'][circle]) { :host([size='medium'][circle]) {
@ -97,8 +90,7 @@
font-size: 12px; font-size: 12px;
} }
.icon { .icon {
width: 14px; --size: 14px;
height: 14px;
} }
} }

View File

@ -8,6 +8,7 @@
<style lang="scss"> <style lang="scss">
:host { :host {
display: inline-block; display: inline-block;
line-height: 1;
font-size: 14px; font-size: 14px;
label { label {
@ -36,31 +37,29 @@
} }
:host([size='large']) { :host([size='large']) {
font-size: 16px;
label { label {
width: 58px; height: 42px;
height: 32px;
}
.dot {
--size: 26px;
}
}
:host([size='medium']) {
label {
width: 50px;
height: 28px;
} }
.dot { .dot {
--size: 22px; --size: 22px;
} }
} }
:host([size='mini']) { :host([size='medium']) {
label { label {
width: 22px; height: 38px;
height: 14px;
padding: 2px;
} }
.dot { .dot {
--size: 10px; --size: 20px;
}
}
:host([size='mini']) {
font-size: 12px;
label {
height: 20px;
}
.dot {
--size: 14px;
} }
} }
@ -157,8 +156,12 @@ export default class Checkbox {
} }
set value(val) { set value(val) {
if (Array.isArray(val)) {
this.props.value = val this.props.value = val
this.checked = this.props.value.includes(this.props.label) this.checked = this.props.value.includes(this.props.label)
} else {
throw TypeError(':duplex指令需要传入一个数组, 当前为: ' + typeof val)
}
} }
get checked() { get checked() {

View File

@ -8,6 +8,7 @@
<style lang="scss"> <style lang="scss">
:host { :host {
display: inline-block; display: inline-block;
line-height: 1;
font-size: 14px; font-size: 14px;
label { label {

View File

@ -11,6 +11,7 @@
display: none; display: none;
} }
.icon { .icon {
display: block;
width: var(--size, 32px); width: var(--size, 32px);
height: var(--size, 32px); height: var(--size, 32px);
fill: currentColor; fill: currentColor;