Skip to content

Commit 49bde5c

Browse files
author
liyuan-meng
committed
[InputNumber]使用 addonBefore 和 addonAfter时,修改布局为 inline-flex 行内布局
1 parent 756d4de commit 49bde5c

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

src/components/input-number/demos/complex.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@ import { InputNumber } from 'cloud-react';
1515

1616
export default function InputDemo() {
1717
return (
18-
<div>
19-
<InputNumber style={{ marginBottom: 20, width: 200 }} placeholder="请输入" size="small" noStep addonAfter="" />
20-
<InputNumber style={{ marginBottom: 20, width: 200 }} placeholder="请输入" noStep addonAfter="" />
21-
<InputNumber style={{ marginBottom: 20, width: 200 }} placeholder="请输入" size="large" noStep addonAfter="" />
22-
<InputNumber style={{ width: 200 }} placeholder="请输入" addonBefore="¥" />
18+
<div style={{ display: 'flex', flexDirection: 'column', gap: 10, flexWrap: 'wrap' }}>
19+
<h5>后置</h5>
20+
<div style={{ display: 'flex', gap: 10, flexWrap: 'wrap' }}>
21+
<InputNumber style={{ width: 200 }} placeholder="请输入" size="large" noStep addonAfter="" />
22+
<InputNumber style={{ width: 200 }} placeholder="请输入" noStep addonAfter="" />
23+
<InputNumber style={{ width: 200 }} placeholder="请输入" size="small" noStep addonAfter="" />
24+
</div>
25+
<h5>前置</h5>
26+
<div style={{ display: 'flex', gap: 10, flexWrap: 'wrap' }}>
27+
<InputNumber style={{ width: 200 }} placeholder="请输入" size="large" addonBefore="¥" />
28+
<InputNumber style={{ width: 200 }} placeholder="请输入" addonBefore="$" />
29+
<InputNumber style={{ width: 200 }} placeholder="请输入" size="small" addonBefore="¥" />
30+
</div>
2331
</div>
2432
);
2533
}

src/components/input-number/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
}
233233

234234
&-add-on-container {
235-
display: flex;
235+
display: inline-flex;
236236
align-items: center;
237237

238238
.add-on {

0 commit comments

Comments
 (0)