边框由标题和主体两部分组成。上下异形边框效果。
如果您需要设计属于自己的数据可视化大屏或数据可视化大屏开发 请联系我们微信:17331886870
组件代码
/**
* @Author: 858834013@qq.com
* @Name: pageItem
* @Date: 2023年06月19日21:58:03
* @Desc: 异形边框
*/
<template>
<div class="pageItemBody">
<div class="titleInfo">
<span>{{ title }}</span>
</div>
<div class="itemMain">
<slot></slot>
</div>
<bg></bg>
</div>
</template>
<script>
import bg from './bg.vue'
export default {
name: "title",
data() {
return {}
},
components: {
bg
},
props: {
title: {
type: String,
default() {
return '标题';
}
},
},
watch: {},
mounted() {
var that = this;
},
}
</script>
<style lang="scss" scoped>
.pageItemBody {
width: 100%;
position: relative;
height: 100%;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-wrap: nowrap;
flex-direction: column;
z-index: 1;
align-content: flex-start;
.titleInfo {
display: flex;
height: 60px;
position: relative;
width: calc(100% - 17px - 15px);
margin-left: 17px;
justify-content: flex-start;
align-items: center;
flex-wrap: nowrap;
flex-direction: row;
align-content: flex-start;
span {
font-size: 20px;
font-family: AlimamaShuHeiTi;
font-weight: bold;
color: #00A8FF;
line-height: 20px;
background: linear-gradient(180deg, #FFFFFF 0.2685546875%, #0C91B8 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
.itemMain {
position: relative;
width: 100%;
height: calc(100% - 60px);
}
</style>
异形背景
/**
* @Author: 858834013@qq.com
* @Name: gridView
* @Date: 2023年06月19日21:58:28
* @Desc: 异形背景
*/
<template>
<div class="gridView">
<!-- 左上角-->
<div class="gLeftTop"></div>
<!-- 顶部中间-->
<div class="gTopCenter"></div>
<!-- 右上角-->
<div class="gRightTop"></div>
<!-- 左下角-->
<div class="gLeftBottom"></div>
<!-- 底部中间-->
<div class="gBottomCenter"></div>
<!-- 右下角-->
<div class="gRightBottom"></div>
</div>
</template>
<script>
export default {
name: "gridView"
}
</script>
<style lang="scss" scoped>
.gridView {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-height: 80px;
min-width: 250px;
bottom: 0;
right: 0;
background: rgba(#031035, 0.6);
z-index: -1;
pointer-events: none; //避免div层被点击
//左上角
.gLeftTop {
background: url("./assets/left_top.png") no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
width: 111PX;
height: 16PX;
}
//顶部中间
.gTopCenter {
width: calc(100% - 111PX - 74PX);
left: 111PX;
position: absolute;
height: 7PX;
background: url("./assets/top.png") repeat-x;
background-size: 100% 100%;
}
//右上角
.gRightTop {
background: url("./assets/right_top.png") no-repeat;
background-size: 100% 100%;
position: absolute;
right: 0;
top: 0;
width: 74PX;
height: 91PX;
}
//左下角
.gLeftBottom {
background: url("./assets/left_bottom.png") no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
bottom: 0;
width: 9PX;
height: 15PX;
}
//底部中间
.gBottomCenter {
width: calc(100% - 9PX - 61PX);
left: 9PX;
bottom: 0;
position: absolute;
height: 6PX;
background: url("./assets/bottom.png") repeat-x;
background-size: 100% 100%;
}
//右下角
.gRightBottom {
background: url("./assets/right_bottom.png") no-repeat;
background-size: 100% 100%;
position: absolute;
right: 0;
bottom: 0;
width: 61PX;
height: 15PX;
}
}
</style>
更多边框组件
组件实例代码下载
项目代码 vue3 vite js nodejs 14