102 lines
1.9 KiB
Vue
102 lines
1.9 KiB
Vue
<!--
|
|
filename: widgetContainer.vue
|
|
author: liubin
|
|
date: 2023-09-08 13:31:18
|
|
description:
|
|
-->
|
|
|
|
<template>
|
|
<div class="yx-dark-widget-container">
|
|
<div class="icon" :class="iconClass"></div>
|
|
<div class="content">
|
|
<div class="title">{{ title }}</div>
|
|
<div class="value">{{ value }}</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "YxDarkWidgetContainer",
|
|
components: {},
|
|
props: ["title", "value", "icon"],
|
|
data() {
|
|
return {};
|
|
},
|
|
computed: {
|
|
iconClass() {
|
|
switch (this.icon) {
|
|
case "1":
|
|
return "icon-1";
|
|
case "2":
|
|
return "icon-2";
|
|
case "3":
|
|
return "icon-3";
|
|
case "4":
|
|
return "icon-4";
|
|
}
|
|
},
|
|
},
|
|
methods: {},
|
|
};
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.yx-dark-widget-container {
|
|
width: 200px;
|
|
height: 98px;
|
|
border-radius: 4px;
|
|
box-shadow: inset 0 0 17px 0 #fff8;
|
|
// background: url(../../../assets/) 100% / contain no-repeat;
|
|
display: flex;
|
|
padding: 4px;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.icon {
|
|
width: 58px;
|
|
height: 58px;
|
|
background: #cfcfff;
|
|
// background: url(../../../assets/) 100% / contain no-repeat;
|
|
}
|
|
|
|
.content {
|
|
// padding-left: 12px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
// justify-content: center;
|
|
align-items: flex-start;
|
|
height: 100%;
|
|
}
|
|
|
|
.title {
|
|
padding-top: 14px;
|
|
font-size: 14px;
|
|
line-height: 1;
|
|
color: #fffa;
|
|
}
|
|
|
|
.value {
|
|
padding-top: 10px;
|
|
font-size: 32px;
|
|
line-height: 34px;
|
|
color: #fff;
|
|
}
|
|
|
|
.icon-1 {
|
|
background: url(../../../../assets/icon-1.png) 100% / contain no-repeat;
|
|
}
|
|
|
|
.icon-2 {
|
|
background: url(../../../../assets/icon-2.png) 100% / contain no-repeat;
|
|
}
|
|
|
|
.icon-3 {
|
|
background: url(../../../../assets/icon-3.png) 100% / contain no-repeat;
|
|
}
|
|
|
|
.icon-4 {
|
|
background: url(../../../../assets/icon-4.png) 100% / contain no-repeat;
|
|
}
|
|
</style>
|