Newer
Older
Nanping_sponge_JXKH / src / components / Card / index.vue
@liyingjing liyingjing on 25 Oct 528 bytes 海绵绩效考个
<template>
  <el-card
    class="box-card"
    v-bind="attrs"
  >
    <template #header>
      <div class="card-header">
        <slot name="header" v-if="slots.header"></slot>
        <span v-else>{{ attrs.header }}</span>
      </div>
    </template>
    <slot></slot>
  </el-card>
</template>

<script setup>
import { useAttrs, useSlots } from 'vue'
const attrs = useAttrs()
const slots = useSlots()
</script>

<style lang="scss" scoped>
.box-card {
  .card-header {
    font-weight: 700;
    font-size: 16px;
  }
}
</style>