Skip to content

Commit

Permalink
perf: lego组件库更新写法,去掉warning
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuyan committed Nov 8, 2023
1 parent fdb209e commit 5d70073
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-news-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@td-design/lego': patch
---

perf: lego组件库更新写法,去掉warning
12 changes: 4 additions & 8 deletions packages/lego/src/horizontal-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ export default forwardRef<ReactEcharts, HorizontalBarProps>(
show: true,
},
axisLabel: {
...theme.typography[inModal ? 'p0' : 'p2'],
show: true,
textStyle: {
...theme.typography[inModal ? 'p0' : 'p2'],
color: theme.colors.gray100,
},
color: theme.colors.gray100,
},
axisTick: {
show: true,
Expand Down Expand Up @@ -164,11 +162,9 @@ export default forwardRef<ReactEcharts, HorizontalBarProps>(
]),
},
label: {
...theme.typography[inModal ? 'p0' : 'p2'],
color: theme.colors.gray100,
formatter: '{b}',
textStyle: {
...theme.typography[inModal ? 'p0' : 'p2'],
color: theme.colors.gray100,
},
position: 'left',
distance: 10, // 向右偏移位置
show: true,
Expand Down
6 changes: 2 additions & 4 deletions packages/lego/src/img-line/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,8 @@ export default forwardRef<ReactEcharts, ImgLineProps>(
},
},
areaStyle: {
normal: {
color: getAreaColorsByIndex(index),
shadowColor: getColorsByIndex(index),
},
color: getAreaColorsByIndex(index),
shadowColor: getColorsByIndex(index),
},
})),
},
Expand Down
4 changes: 2 additions & 2 deletions packages/lego/src/progress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default forwardRef<ReactEcharts, ProgressProps>(
},
itemStyle: {
color: createLinearGradient(theme.colors.primary50, false),
barBorderRadius: 11,
borderRadius: 11,
},
},
{
Expand All @@ -121,7 +121,7 @@ export default forwardRef<ReactEcharts, ProgressProps>(
},
itemStyle: {
color: createLinearGradient(theme.colors.primary100, false),
barBorderRadius: 11,
borderRadius: 11,
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions packages/lego/src/radar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export default forwardRef<ReactEcharts, RadarProps>(
radar: {
center: ['50%', '50%'],
radius: '70%',
nameGap: 5,
name: {
axisNameGap: 5,
axisName: {
formatter: (_: string, indicator: IndicatorItem) => {
return `{a|${indicator.name ?? ''}}\n{a|${indicator.max}${indicator.unit ?? ''}}`;
},
Expand Down
6 changes: 2 additions & 4 deletions packages/lego/src/utils/createStackSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ export default function createStackSeries(
symbolSize: ['100%', 10],
symbolRotate: 0,
itemStyle: {
normal: {
borderWidth: 0,
color: chartColor[0][0],
},
borderWidth: 0,
color: chartColor[0][0],
},
animation: false,
barMaxWidth: 20,
Expand Down

0 comments on commit 5d70073

Please sign in to comment.