<script lang="ts" setup name="benchCol"> // 逻辑代码 const props = defineProps({ title: { type: String, default: '', }, pathUrl: { type: String, default: '', }, width: { type: String, default: '', }, height: { type: String, default: '', }, }) </script> <template> <div class="bench-left-top" :style="{ width, height }"> <div class="bench-title"> <h3 v-if="title !== ''"> {{ title }} </h3> <span v-if="pathUrl !== ''" style="cursor: pointer;font-size: 14px; color: #ccc;" @click="$router.push(pathUrl)">更多 ></span> </div> <slot /> </div> </template> <style lang="scss" scoped> .bench-title { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; overflow: hidden; } // 样式 .bench-left-top { border-radius: 10px; margin-top: 1%; background-color: #fff; } </style>