Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
钟摆人-Puppet゜
ant-design-pro
提交
e1290d8e
A
ant-design-pro
项目概览
钟摆人-Puppet゜
/
ant-design-pro
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design-pro
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e1290d8e
编写于
2月 18, 2019
作者:
S
Shuai Chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: use requestAnimationFrame
上级
9da468f4
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
16 addition
and
17 deletion
+16
-17
src/components/ActiveChart/index.js
src/components/ActiveChart/index.js
+10
-12
src/components/Charts/AsyncLoadBizCharts.js
src/components/Charts/AsyncLoadBizCharts.js
+4
-2
src/components/Charts/index.js
src/components/Charts/index.js
+2
-2
src/pages/Dashboard/Analysis.js
src/pages/Dashboard/Analysis.js
+0
-1
未找到文件。
src/components/ActiveChart/index.js
浏览文件 @
e1290d8e
...
@@ -33,7 +33,6 @@ export default class ActiveChart extends Component {
...
@@ -33,7 +33,6 @@ export default class ActiveChart extends Component {
}
}
loopData
=
()
=>
{
loopData
=
()
=>
{
this
.
requestRef
=
requestAnimationFrame
(()
=>
{
this
.
timer
=
setTimeout
(()
=>
{
this
.
timer
=
setTimeout
(()
=>
{
this
.
setState
(
this
.
setState
(
{
{
...
@@ -43,8 +42,7 @@ export default class ActiveChart extends Component {
...
@@ -43,8 +42,7 @@ export default class ActiveChart extends Component {
this
.
loopData
();
this
.
loopData
();
}
}
);
);
},
1000
);
},
500
);
});
};
};
render
()
{
render
()
{
...
...
src/components/Charts/AsyncLoadBizCharts.js
浏览文件 @
e1290d8e
...
@@ -24,9 +24,11 @@ class AsyncLoadBizCharts extends React.Component {
...
@@ -24,9 +24,11 @@ class AsyncLoadBizCharts extends React.Component {
async
componentDidMount
()
{
async
componentDidMount
()
{
await
loadBizCharts
();
await
loadBizCharts
();
requestAnimationFrame
(()
=>
{
this
.
setState
({
this
.
setState
({
loading
:
false
,
loading
:
false
,
});
});
});
}
}
render
()
{
render
()
{
...
...
src/components/Charts/index.js
浏览文件 @
e1290d8e
import
React
,
{
Suspense
}
from
'
react
'
;
import
React
,
{
Suspense
}
from
'
react
'
;
import
numeral
from
'
numeral
'
;
import
numeral
from
'
numeral
'
;
import
ChartCard
from
'
./ChartCard
'
;
import
ChartCard
from
'
./ChartCard
'
;
import
Field
from
'
./Field
'
;
const
getComponent
=
Component
=>
{
const
getComponent
=
Component
=>
{
return
props
=>
{
return
props
=>
{
return
(
return
(
<
Suspense
fallback
=
{
null
}
>
<
Suspense
fallback
=
"
...
"
>
<
Component
{...
props
}
/
>
<
Component
{...
props
}
/
>
<
/Suspense
>
<
/Suspense
>
);
);
...
@@ -19,7 +20,6 @@ const Gauge = getComponent(React.lazy(() => import('./Gauge')));
...
@@ -19,7 +20,6 @@ const Gauge = getComponent(React.lazy(() => import('./Gauge')));
const
MiniArea
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniArea
'
)));
const
MiniArea
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniArea
'
)));
const
MiniBar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniBar
'
)));
const
MiniBar
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniBar
'
)));
const
MiniProgress
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniProgress
'
)));
const
MiniProgress
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./MiniProgress
'
)));
const
Field
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./Field
'
)));
const
WaterWave
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./WaterWave
'
)));
const
WaterWave
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./WaterWave
'
)));
const
TagCloud
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./TagCloud
'
)));
const
TagCloud
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./TagCloud
'
)));
const
TimelineChart
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./TimelineChart
'
)));
const
TimelineChart
=
getComponent
(
React
.
lazy
(()
=>
import
(
'
./TimelineChart
'
)));
...
...
src/pages/Dashboard/Analysis.js
浏览文件 @
e1290d8e
...
@@ -25,7 +25,6 @@ class Analysis extends Component {
...
@@ -25,7 +25,6 @@ class Analysis extends Component {
};
};
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
'
run
'
);
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
this
.
reqRef
=
requestAnimationFrame
(()
=>
{
this
.
reqRef
=
requestAnimationFrame
(()
=>
{
dispatch
({
dispatch
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录