Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_38687364
VUE3仪表盘
提交
c6a2b7ef
V
VUE3仪表盘
项目概览
weixin_38687364
/
VUE3仪表盘
与 Fork 源项目一致
Fork自
inscode / VueJS
通知
2
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
VUE3仪表盘
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c6a2b7ef
编写于
7月 09, 2023
作者:
6
64493bc96180332c2cd697c0
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sun Jul 9 07:49:00 UTC 2023 inscode
上级
7a093d7e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
201 addition
and
38 deletion
+201
-38
src/App.vue
src/App.vue
+2
-38
src/components/Dashboard.vue
src/components/Dashboard.vue
+199
-0
未找到文件。
src/App.vue
浏览文件 @
c6a2b7ef
<
script
setup
>
import
HelloWorld
from
'
./components/HelloWorld.vue
'
import
TheWelcome
from
'
./components/TheWelcome.vue
'
import
Dashboard
from
'
./components/Dashboard.vue
'
</
script
>
<
template
>
<header>
<img
alt=
"Vue logo"
class=
"logo"
src=
"./assets/logo.svg"
width=
"125"
height=
"125"
/>
<div
class=
"wrapper"
>
<HelloWorld
msg=
"You did it!"
/>
</div>
</header>
<main>
<TheWelcome
/>
</main>
<Dashboard></Dashboard>
</
template
>
<
style
scoped
>
header
{
line-height
:
1.5
;
}
.logo
{
display
:
block
;
margin
:
0
auto
2rem
;
}
@media
(
min-width
:
1024px
)
{
header
{
display
:
flex
;
place-items
:
center
;
padding-right
:
calc
(
var
(
--section-gap
)
/
2
);
}
.logo
{
margin
:
0
2rem
0
0
;
}
header
.wrapper
{
display
:
flex
;
place-items
:
flex-start
;
flex-wrap
:
wrap
;
}
}
</
style
>
src/components/Dashboard.vue
0 → 100644
浏览文件 @
c6a2b7ef
<
template
>
<div
class=
"cont"
>
<div
class=
"layout"
>
<div
class=
"das-warpper"
>
<div
class=
"das"
>
<div
class=
"diamond-warpper"
>
<span
class=
"diamond"
>
<span
class=
"triangle-top"
></span>
<span
class=
"triangle-down"
></span>
</span>
</div>
<div
class=
"annular"
:style=
"
'background: linear-gradient(90deg, #1c81cf 0%, transparent ' +
per +
'%);'
"
></div>
<div
class=
"text-warpper"
></div>
<div
class=
"text"
>
{{
per
}}
%
</div>
</div>
</div>
<div
class=
"bottom-box"
>
<span
class=
"left-gradient"
></span>
<span
class=
"title"
>
{{
title
}}
</span>
<span
class=
"right-gradient"
></span>
</div>
</div>
</div>
</
template
>
<
script
setup
>
import
{
ref
,
onMounted
,
watch
}
from
"
vue
"
;
import
{
toRefs
}
from
"
vue
"
;
const
props
=
defineProps
({
title
:
{
type
:
String
,
default
:
"
VIP会议室 - 1
"
,
},
per
:
{
type
:
Number
,
default
:
75
,
},
});
const
{
title
,
per
}
=
toRefs
(
props
);
console
.
log
(
title
.
value
,
per
.
value
);
watch
(
()
=>
per
.
value
,
(
newVal
,
oldVal
)
=>
{
console
.
log
(
newVal
,
oldVal
);
changeper
();
}
);
const
changeper
=
()
=>
{
let
p
=
per
.
value
;
let
deg
=
(
180
*
p
)
/
100
-
90
;
// 修改annular样式
const
annular
=
document
.
querySelector
(
"
.annular
"
);
annular
.
style
.
background
=
`linear-gradient(90deg, #1c81cf 0%, transparent
${
per
}
%)`
;
// 修改diamond - warpper 样式
const
diamondWarpper
=
document
.
querySelector
(
"
.diamond-warpper
"
);
diamondWarpper
.
style
.
transform
=
`rotateZ(
${
deg
}
deg)`
;
diamondWarpper
.
style
.
animation
=
`run
${
p
}
2s 1`
;
// 创建新的 keyframes 规则
const
newKeyFrames
=
`@keyframes run
${
p
}
{
from {
transform: rotateZ(-90deg);
}
to {
transform: rotateZ(
${
deg
}
deg);
}
}`
;
// 将原有的 keyframes 规则替换为新的规则
const
styleSheet
=
document
.
styleSheets
[
0
];
styleSheet
.
deleteRule
(
0
);
styleSheet
.
insertRule
(
newKeyFrames
,
0
);
};
</
script
>
<
style
scoped
>
.cont
{
background-color
:
#0a1b49
;
color
:
#fff
;
width
:
160px
;
height
:
110px
;
}
.das-warpper
{
height
:
81px
;
overflow
:
hidden
;
}
.das
{
box-sizing
:
border-box
;
position
:
relative
;
width
:
150px
;
height
:
150px
;
border
:
1px
dashed
#1a75bf
;
border-radius
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
position
:
relative
;
}
.annular
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
90%
;
height
:
90%
;
border-radius
:
50%
;
-webkit-mask
:
radial-gradient
(
transparent
,
transparent
60%
,
#000
60%
);
}
.diamond-warpper
{
position
:
absolute
;
display
:
inline-block
;
width
:
50%
;
height
:
90%
;
z-index
:
200
;
transform
:
rotateZ
(
45deg
);
display
:
flex
;
justify-content
:
center
;
align-items
:
flex-start
;
animation
:
run
2s
1
;
}
.diamond
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-direction
:
column
;
}
.triangle-top
{
width
:
0
;
height
:
0
;
border-left
:
4px
solid
transparent
;
border-right
:
4px
solid
transparent
;
border-bottom
:
10px
solid
#00a0e9
;
margin-bottom
:
-1px
;
}
.triangle-down
{
width
:
0
;
height
:
0
;
border-left
:
4px
solid
transparent
;
border-right
:
4px
solid
transparent
;
border-top
:
10px
solid
#00a0e9
;
}
.bottom-box
{
width
:
100%
;
position
:
absolute
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
bottom
:
-25px
;
}
.text-warpper
{
position
:
absolute
;
width
:
40%
;
height
:
40%
;
border-radius
:
100%
;
z-index
:
200
;
}
.text
{
position
:
absolute
;
top
:
30%
;
font-size
:
30px
;
font-weight
:
bold
;
z-index
:
300
;
}
.left-gradient
{
width
:
20px
;
height
:
5px
;
background
:
linear-gradient
(
to
left
,
#1c81cf
,
transparent
);
}
.right-gradient
{
width
:
20px
;
height
:
5px
;
background
:
linear-gradient
(
to
right
,
#1c81cf
,
transparent
);
}
.title
{
border-radius
:
5px
;
font-size
:
12px
;
text-align
:
center
;
margin
:
0px
4px
;
}
.layout
{
width
:
150px
;
position
:
relative
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
</
style
>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录