<template> <div class="card"> <div class="header"> <div class="left"></div> <div class="title">{{ props.title }}</div> <div class="tips" v-if="props.tips">{{ props.tips }}</div> <div class="right"></div> </div> <div class="body"> <slot /> </div> </div> </template> <script setup> import { ref } from 'vue' const props = defineProps({ title: { type: String, default: '' }, tips: { type: String, default: '' } }) </script> <style lang="scss" scoped> .card { height: 100%; width: 100%; color: #fff; .header { width: 100%; height: 38px; background: linear-gradient(90deg, rgba(2,71,157,0.4) 0%, rgba(24,65,147,0.1) 100%); display: flex; align-items: center; justify-content: space-between; position: relative; .left { width: 32px; height: 32px; background: url('@/assets/images/document/thematicMap/tou.png') no-repeat; background-size: 100% 100%; } .title { font-size: 18px; font-weight: bold; color: #FFFFFF; position: absolute; left: 46px; top: 6px; } .tips { font-size: 12px; color: #4198F3; position: absolute; left: 136px; top: 10px; } .right { width: 14px; height: 32px; background: url('@/assets/images/document/thematicMap/wei.png') no-repeat; background-size: 100% 100%; } } .body { margin-top: 12px; height: calc(100% - 50px); } } </style>