Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
可视化 csdn 数据
提交
e00da37c
可
可视化 csdn 数据
项目概览
yma16
/
可视化 csdn 数据
该项目与 Fork 源项目分叉
Fork自
inscode / VueJS
通知
17
Star
15
Fork
10
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
可
可视化 csdn 数据
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e00da37c
编写于
5月 15, 2024
作者:
Q
qq_38870145
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Wed May 15 09:37:00 CST 2024 inscode
上级
4735d8e5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
22 deletion
+38
-22
src/App.vue
src/App.vue
+4
-4
src/components/visual/index.vue
src/components/visual/index.vue
+34
-18
未找到文件。
src/App.vue
浏览文件 @
e00da37c
...
...
@@ -10,10 +10,10 @@ import "dayjs/locale/zh-cn";
import
{
useStore
}
from
"
vuex
"
;
import
{
WebPerformance
}
from
'
web-performance-tool
'
;
onMounted
(()
=>
{
const
WebPerformanceInstance
=
new
WebPerformance
();
// 计算性能
WebPerformanceInstance
.
calcPerformance
();
console
.
log
(
'
性能指标:
'
,
WebPerformanceInstance
.
getPerformance
())
//
const WebPerformanceInstance=new WebPerformance();
//
//
计算性能
//
WebPerformanceInstance.calcPerformance();
//
console.log('性能指标:',WebPerformanceInstance.getPerformance())
})
dayjs
.
locale
(
"
zh-cn
"
);
...
...
src/components/visual/index.vue
浏览文件 @
e00da37c
<
script
setup
>
import
{
reactive
,
onMounted
}
from
'
vue
'
import
CommitLine
from
'
./commit/index.vue
'
import
ArticleBar
from
'
./article/index.vue
'
import
Author
from
'
../Author.vue
'
import
HubPie
from
'
./hub/index.vue
'
import
{
articleData
}
from
'
./data/data.js
'
const
state
=
reactive
({
title
:
''
,
articleData
:[]
})
import
{
reactive
,
onMounted
,
onBeforeMount
}
from
'
vue
'
import
CommitLine
from
'
./commit/index.vue
'
import
ArticleBar
from
'
./article/index.vue
'
import
Author
from
'
../Author.vue
'
import
HubPie
from
'
./hub/index.vue
'
import
{
articleData
}
from
'
./data/data.js
'
const
state
=
reactive
({
title
:
''
,
articleData
:
[],
echartDuration
:
0
,
})
const
getRenderBarData
=
()
=>
{
state
.
articleData
=
[...
articleData
]
state
.
articleData
.
sort
((
a
,
b
)
=>
new
Date
(
a
.
postTime
)
-
new
Date
(
b
.
postTime
))
}
onMounted
(()
=>
{
getRenderBarData
()
})
const
getRenderBarData
=
()
=>
{
state
.
articleData
=
[...
articleData
]
state
.
articleData
.
sort
((
a
,
b
)
=>
new
Date
(
a
.
postTime
)
-
new
Date
(
b
.
postTime
))
}
onBeforeMount
(()
=>
{
// 标记开始时刻
performance
.
mark
(
'
render-echart1-start
'
)
})
onMounted
(()
=>
{
getRenderBarData
()
// 标记开始时刻
performance
.
mark
(
'
render-echart1-end
'
)
const
measure
=
performance
.
measure
(
'
render-echart-duration
'
,
'
render-echart1-start
'
,
'
render-echart1-end
'
)
console
.
log
(
'
measure
'
,
measure
)
console
.
log
(
'
measure type
'
,
typeof
measure
)
const
duration
=
measure
.
duration
console
.
log
(
'
duration
'
,
duration
)
state
.
echartDuration
=
duration
.
toFixed
(
2
)
})
</
script
>
<
template
>
<div
style=
"padding:20px;"
>
<!--
<Author/>
-->
<div>
{{
state
.
title
}}
{{
state
.
title
}}
<div>
<CommitLine
/>
<ArticleBar
:tableData=
"state.articleData"
/>
<HubPie
/>
</div>
<div>
渲染耗时:
{{
state
.
echartDuration
}}
ms
</div>
</div>
</div>
</
template
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录