48 lines
820 B
Vue
48 lines
820 B
Vue
<template>
|
|
<div class="block-item">
|
|
<slot v-if="title" name="header">
|
|
<div class="header">
|
|
<div class="header-title">{{ title }}</div>
|
|
<div class="header-extra" v-if="$slots.headerExtra">
|
|
<slot name="headerExtra"></slot>
|
|
</div>
|
|
</div>
|
|
</slot>
|
|
|
|
<slot />
|
|
</div>
|
|
</template>
|
|
<script setup>
|
|
import { onMounted, ref } from 'vue'
|
|
|
|
const props = defineProps({
|
|
title: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
})
|
|
|
|
</script>
|
|
<style scoped lang="scss">
|
|
.block-item {
|
|
position: relative;
|
|
width: 100%;
|
|
|
|
& + .block-item {
|
|
margin-top: 10px;
|
|
}
|
|
}
|
|
.header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 18px;
|
|
}
|
|
.header-title {
|
|
font-weight: 500;
|
|
font-size: 15px;
|
|
color: #4a4a4a;
|
|
line-height: 16px;
|
|
}
|
|
</style>
|