<script setup>
|
import {computed} from "vue";
|
|
const props = defineProps({
|
type: {
|
type: String,
|
default: "",
|
},
|
title: {
|
type: String,
|
default: "",
|
},
|
noHeader: {
|
type: Boolean,
|
default: false,
|
},
|
noHeaderBg: {
|
type: Boolean,
|
default: false,
|
},
|
size: {
|
type: String,
|
default: "",
|
},
|
});
|
|
const sizeClass = computed(()=>{
|
let size = props.size;
|
let result = "";
|
switch (size) {
|
case "mini":
|
result = "flex-box-mini";
|
break;
|
}
|
return result;
|
});
|
</script>
|
|
<template>
|
<div class="flex-box">
|
<div class="flex-box-border border-top-left"></div>
|
<div class="flex-box-border border-top-right"></div>
|
<div class="flex-box-border border-bottom-left"></div>
|
<div class="flex-box-border border-bottom-right"></div>
|
<div class="flex-box-header" v-if="!noHeader">
|
<slot name="header"></slot>
|
</div>
|
<div class="flex-box-body">
|
<slot></slot>
|
</div>
|
<div class="flex-box-footer">
|
<slot name="footer"></slot>
|
</div>
|
</div>
|
</template>
|
|
<style lang="less" scoped>
|
@border-color: #00feff;
|
@size: 32px;
|
.flex-box {
|
position: relative;
|
display: flex;
|
flex-direction: column;
|
height: 100%;
|
background-image: radial-gradient(#151f4140, rgba(23, 54, 140, 0.25));
|
|
>.flex-box-border {
|
position: absolute;
|
z-index: 9;
|
width: 20px;
|
height: 20px;
|
box-sizing: border-box;
|
|
&.border-top-left {
|
top: 0;
|
left: 0;
|
border-top: 2px solid @border-color;
|
border-left: 2px solid @border-color;
|
}
|
|
&.border-top-right {
|
top: 0;
|
right: 0;
|
border-top: 2px solid @border-color;
|
border-right: 2px solid @border-color;
|
}
|
|
&.border-bottom-left {
|
bottom: 0;
|
left: 0;
|
border-bottom: 2px solid @border-color;
|
border-left: 2px solid @border-color;
|
}
|
|
&.border-bottom-right {
|
bottom: 0;
|
right: 0;
|
border-bottom: 2px solid @border-color;
|
border-right: 2px solid @border-color;
|
}
|
}
|
>.flex-box-body {
|
flex: 1;
|
}
|
}
|
</style>
|