File tree Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 133
133
"increase-memory-limit" : " ^1.0.7" ,
134
134
"jest" : " ^24.9.0" ,
135
135
"jest-environment-jsdom-sixteen" : " ^2.0.0" ,
136
- "ko-lint-config" : " ^ 2.2.18 " ,
136
+ "ko-lint-config" : " 2.2.19 " ,
137
137
"less" : " ^3.9.0" ,
138
138
"less-loader" : " ^5.0.0" ,
139
139
"lint-md" : " ^0.1.1" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Tooltip } from 'antd';
4
4
5
5
export interface BlockHeaderProps {
6
6
// 标题
7
- title : string ;
7
+ title : React . ReactNode ;
8
8
// 标题前的图标,默认是一个色块
9
9
beforeTitle ?: React . ReactNode ;
10
10
// 标题后的提示图标或文案
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ stories.addDecorator(withKnobs);
10
10
const propDefinitions = [
11
11
{
12
12
property : 'title' ,
13
- propType : 'string ' ,
13
+ propType : 'React.ReactNode ' ,
14
14
required : true ,
15
15
description : '标题' ,
16
16
defaultValue : '-' ,
@@ -136,6 +136,10 @@ stories.add(
136
136
<BlockHeader title="分类标题" onChange={(expand) => console.log(expand)}>
137
137
Hello World!
138
138
</BlockHeader>
139
+ <p style={style}>7、标题超长</p>
140
+ <BlockHeader title={<EllipsisText maxWidth={400} value="标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长" />} />
141
+ <br />
142
+
139
143
<h3>大标题 + 无背景</h3>
140
144
<p style={style}>1、默认</p>
141
145
<BlockHeader title="分类标题" showBackground={false} />
@@ -159,6 +163,7 @@ stories.add(
159
163
>
160
164
Hello World!
161
165
</BlockHeader>
166
+
162
167
<h2>小标题</h2>
163
168
<h3>小标题 + 有背景</h3>
164
169
<p style={style}>1、默认</p>
@@ -183,6 +188,8 @@ stories.add(
183
188
>
184
189
Hello World!
185
190
</BlockHeader>
191
+ <br />
192
+
186
193
<h3>小标题 + 无背景</h3>
187
194
<p style={style}>1、默认</p>
188
195
<BlockHeader title="分类标题" showBackground={false} isSmall />
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { PieChartOutlined } from '@ant-design/icons' ;
3
3
import BlockHeader from '../../../components/blockHeader' ;
4
+ import EllipsisText from '../../../components/ellipsisText' ;
4
5
5
6
export default function BlockHeaderRender ( ) {
6
7
const style = {
@@ -28,6 +29,10 @@ export default function BlockHeaderRender() {
28
29
< BlockHeader title = "分类标题" onChange = { ( expand ) => console . log ( expand ) } >
29
30
Hello World!
30
31
</ BlockHeader >
32
+ < p style = { style } > 7、标题超长</ p >
33
+ < BlockHeader title = { < EllipsisText maxWidth = { 400 } value = "标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长标题超长" /> } />
34
+ < br />
35
+
31
36
< h3 > 大标题 + 无背景</ h3 >
32
37
< p style = { style } > 1、默认</ p >
33
38
< BlockHeader title = "分类标题" showBackground = { false } />
@@ -51,6 +56,7 @@ export default function BlockHeaderRender() {
51
56
>
52
57
Hello World!
53
58
</ BlockHeader >
59
+
54
60
< h2 > 小标题</ h2 >
55
61
< h3 > 小标题 + 有背景</ h3 >
56
62
< p style = { style } > 1、默认</ p >
@@ -71,6 +77,8 @@ export default function BlockHeaderRender() {
71
77
< BlockHeader title = "分类标题" isSmall onChange = { ( expand ) => console . log ( expand ) } >
72
78
Hello World!
73
79
</ BlockHeader >
80
+ < br />
81
+
74
82
< h3 > 小标题 + 无背景</ h3 >
75
83
< p style = { style } > 1、默认</ p >
76
84
< BlockHeader title = "分类标题" showBackground = { false } isSmall />
Original file line number Diff line number Diff line change @@ -12820,10 +12820,10 @@ known-css-properties@^0.25.0:
12820
12820
resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.25.0.tgz#6ebc4d4b412f602e5cfbeb4086bd544e34c0a776"
12821
12821
integrity sha512-b0/9J1O9Jcyik1GC6KC42hJ41jKwdO/Mq8Mdo5sYN+IuRTXs2YFHZC3kZSx6ueusqa95x3wLYe/ytKjbAfGixA==
12822
12822
12823
- ko-lint-config@^ 2.2.18 :
12824
- version "2.2.18 "
12825
- resolved "https://registry.yarnpkg .com/ko-lint-config/-/ko-lint-config-2.2.18 .tgz#ea61ef0a89a4e23b478b0390e69a715cdf08280a "
12826
- integrity sha512-ls5jymX9GjE8atROtwyoIpsOvjYSlXvHwoHH1sZqvJfrS5xHiy+zBe2KP67O1VNudRnIGyJb9J2QqkRdZyCSXA ==
12823
+
12824
+ version "2.2.19 "
12825
+ resolved "https://registry.npmmirror .com/ko-lint-config/-/ko-lint-config-2.2.19 .tgz#23141b8d8bbbb155b4f6113f894df5e5ea9a0741 "
12826
+ integrity sha512-EMdRaxNXXFe90Q2JQNIJeHSRMn1y5LKNrrGVTwRVWvk/jnP3UQ411K4petpATbgkjU36YEDBa6Y3LVXk8asB+Q ==
12827
12827
dependencies:
12828
12828
"@typescript-eslint/eslint-plugin" "5.30.0"
12829
12829
"@typescript-eslint/parser" "5.30.0"
You can’t perform that action at this time.
0 commit comments