Skip to content

Commit 18c731a

Browse files
vaebekagol
authored andcommitted
style(checkbox-group): checkbox-group 组件 direction排列方向样式优化
1 parent e1f2ba2 commit 18c731a

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
@import '../../styles-var/devui-var.scss';
22

33
.#{$devui-prefix}-checkbox__group {
4-
display: inline-block;
5-
}
6-
7-
.#{$devui-prefix}-checkbox--list-inline {
8-
min-height: 28px;
9-
line-height: 28px;
10-
display: flex;
4+
display: inline-flex;
115
flex-wrap: wrap;
126
justify-content: flex-start;
13-
align-items: center;
14-
margin: -8px 0 0 0;
15-
16-
& div:not(:last-child) {
17-
margin-right: 20px;
18-
}
7+
align-items: flex-start;
198

209
& > * {
2110
margin-top: 8px;
2211
}
12+
13+
&.is-row {
14+
flex-direction: row;
15+
16+
& div:not(:last-child) {
17+
margin-right: 20px;
18+
}
19+
}
20+
21+
&.is-column {
22+
flex-direction: column;
23+
}
2324
}

packages/devui-vue/devui/checkbox/src/checkbox-group.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,18 @@ export default defineComponent({
4141
}
4242
};
4343

44+
4445
return (
45-
<div class={ns.e('group')}>
46-
<div class={{ [ns.m('list-inline')]: props.direction === 'row' }}>{getContent()}</div>
46+
<div
47+
class={[
48+
ns.e('group'),
49+
{
50+
'is-row': props.direction === 'row',
51+
'is-column': props.direction === 'column',
52+
},
53+
]}
54+
>
55+
{getContent()}
4756
</div>
4857
);
4958
};

0 commit comments

Comments
 (0)