<template>
  <div class="tag-card">
    <div class="title">
      <slot v-if="$slots.title" name="title" />
      <span v-else>{{ title }}</span>
    </div>
    <div class="card-center"><slot /></div>
  </div>
</template>

<script>
export default {
  props: { title: { type: String, default: '标题' }}
}
</script>

<style lang="scss" scoped>
.tag-card {
  .title {
    color: #333;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    // align-content: center;
    align-items: center;
    &::before {
      content: ""; //设置伪元素的内容为空
      width: 3px;
      height: 16px;
      flex-shrink: 0;
      border-radius: 13px;
      background: #409eff;
      display: inline-block;
      margin-right: 8px;
    }
  }
  .card-center {
    padding: 8px 12px;
    box-sizing: border-box;
  }
}
</style>
