Skip to content

Commit e94b307

Browse files
authored
fix(blockheader): add min-width for title (#533)
* fix(blockheader): add min-width for title * fix: remove sass_binary_site
1 parent 33f10c7 commit e94b307

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.yarnrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
registry "https://registry.yarnpkg.com"
22

3-
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"

src/components/blockHeader/style.scss

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ $card_prefix: "dtc-block-header";
4040
flex: 1;
4141
display: flex;
4242
align-items: center;
43+
min-width: 0;
4344
.#{$card_prefix}-before-title {
4445
margin-right: 8px;
4546
.default {
@@ -55,6 +56,8 @@ $card_prefix: "dtc-block-header";
5556
color: #3D446E;
5657
font-weight: 500;
5758
margin-right: 4px;
59+
flex: 1;
60+
min-width: 0;
5861
}
5962
.#{$card_prefix}-after-title {
6063
display: flex;

src/stories/components/blockHeader/index.tsx

+22-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { PieChartOutlined } from '@ant-design/icons';
33
import BlockHeader from '../../../components/blockHeader';
44
import EllipsisText from '../../../components/ellipsisText';
5+
import { Button } from 'antd';
56

67
export default function BlockHeaderRender() {
78
const style = {
@@ -30,7 +31,27 @@ export default function BlockHeaderRender() {
3031
Hello World!
3132
</BlockHeader>
3233
<p style={style}>7、标题超长</p>
33-
<BlockHeader title={<EllipsisText maxWidth={400} value="标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长" />} />
34+
<BlockHeader
35+
title={
36+
<EllipsisText
37+
maxWidth={400}
38+
value="标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长"
39+
/>
40+
}
41+
/>
42+
<p style={style}>8、标题超长且有 afterTitle</p>
43+
<div style={{ width: '50%' }}>
44+
<BlockHeader
45+
title={
46+
<EllipsisText
47+
maxWidth={'100%'}
48+
value="标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长"
49+
/>
50+
}
51+
afterTitle="这是 afterTitle"
52+
addonAfter={<Button size="small">选择</Button>}
53+
/>
54+
</div>
3455
<br />
3556

3657
<h3>大标题 + 无背景</h3>

0 commit comments

Comments
 (0)