vue3 数据大屏项目开发中,会遇到各种各样的头部,今天整理的是数据可视化大标题头部组件。
如果您需要设计属于自己的数据可视化大屏或开发数据可视化大屏 请联系我们微信:17331886870
效果截图
组件内容
背景加中间为标题
头部大小
1920 * 79
组件代码
/**
* @Author: 858834013@qq.com
* @Name: pageTop
* @Date: 2023年06月05日
* @Desc:
*/
<template>
<div class="pageTop wow fadeInDown">
<div class="left">
</div>
<div class="title">
<span>{{ title }}</span>
</div>
<div class="right">
</div>
</div>
</template>
<script>
import WOW from "wow.js";
import dayjs from 'dayjs'
export default {
name: "pageTop",
components: {},
data() {
return {
date: dayjs().format("YYYY-MM-DD"),
time: dayjs().format("HH:mm:ss"),
}
},
props: {
title: {
type: String,
default() {
return '数据可视化大标题';
}
}
},
computed: {
week() {
var datas = dayjs().day()
var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
return week[datas]
}
},
mounted() {
var that = this;
var wow = new WOW({
boxClass: "wow",
animateClass: "animated",
offset: 0,
mobile: true,
live: true,
callback: function (box) {
},
scrollContainer: null,
resetAnimation: true,
});
wow.init();
setInterval(function () {
that.time = dayjs().format("HH:mm:ss");
}, 1000);
},
methods: {}
}
</script>
<style lang="scss" scoped>
.pageTop {
width: 100%;
background: url("./assets/topbg.png") center top no-repeat;
background-size: 1871px 79px;
height: 79px;
display: flex;
justify-content: center;
align-items: flex-start;
flex-wrap: nowrap;
flex-direction: row;
align-content: flex-start;
.left {
width: calc(30% - 100px);
margin-left: 100px;
position: relative;
height: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
align-content: flex-start;
}
.right {
width: calc(30% - 120px);
margin-right: 120px;
position: relative;
height: 100%;
display: flex;
justify-content: flex-end;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
align-content: flex-start;
}
.title {
display: flex;
width: 40%;
justify-content: center;
align-items: flex-start;
flex-wrap: nowrap;
flex-direction: row;
align-content: flex-start;
position: relative;
height: 100%;
span {
font-family: PangMenZhengDao;
font-size: 40px;
font-weight: 400;
padding-top: 10px;
background: linear-gradient(180deg, #fcfdff 0%, #98cffa 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
</style>