feat(RadioGroup): add direction prop

This commit is contained in:
陈嘉涵
2020-02-10 19:02:30 +08:00
parent 3ad9950c2f
commit 4dd41b23de
8 changed files with 85 additions and 13 deletions
+11 -4
View File
@@ -36,6 +36,10 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
return (this.parent && this.parent.disabled) || this.disabled;
},
direction() {
return (this.parent && this.parent.direction) || null;
},
iconStyle() {
const checkedColor =
this.checkedColor || (this.parent && this.parent.checkedColor);
@@ -120,10 +124,13 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
return (
<div
role={role}
class={bem({
disabled: this.isDisabled,
'label-disabled': this.labelDisabled,
})}
class={bem([
{
disabled: this.isDisabled,
'label-disabled': this.labelDisabled,
},
this.direction,
])}
tabindex={this.tabindex}
aria-checked={String(this.checked)}
onClick={this.onClick}