Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
bf833b03
Commit
bf833b03
authored
Mar 16, 2018
by
ddcat1115
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ChartCard total issue close #1110
parent
aa675880
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
src/components/Charts/ChartCard/index.js
src/components/Charts/ChartCard/index.js
+16
-4
No files found.
src/components/Charts/ChartCard/index.js
View file @
bf833b03
...
...
@@ -4,6 +4,21 @@ import classNames from 'classnames';
import
styles
from
'
./index.less
'
;
const
renderTotal
=
(
total
)
=>
{
let
totalDom
;
switch
(
typeof
total
)
{
case
undefined
:
totalDom
=
null
;
break
;
case
'
string
'
:
totalDom
=
<
div
className
=
{
styles
.
total
}
dangerouslySetInnerHTML
=
{{
__html
:
total
}}
/>
;
break
;
default
:
totalDom
=
<
div
className
=
{
styles
.
total
}
>
{
total
}
<
/div>
;
}
return
totalDom
;
};
const
ChartCard
=
({
loading
=
false
,
contentHeight
,
title
,
avatar
,
action
,
total
,
footer
,
children
,
...
rest
})
=>
{
...
...
@@ -22,10 +37,7 @@ const ChartCard = ({
<
span
className
=
{
styles
.
title
}
>
{
title
}
<
/span
>
<
span
className
=
{
styles
.
action
}
>
{
action
}
<
/span
>
<
/div
>
{
// eslint-disable-next-line
(
total
!==
undefined
)
&&
(
<
div
className
=
{
styles
.
total
}
dangerouslySetInnerHTML
=
{{
__html
:
total
}}
/>
)
}
{
renderTotal
(
total
)}
<
/div
>
<
/div
>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment