<template>
  <div class="title">
    {{ this.text }}
    <span v-if="detailsHandle" @click="detailsHandle && detailsHandle()">{{textRight || "详情"}}</span>
  </div>
</template>
<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    text: {
      type: String,
      required: true,
    },
    detailsHandle: {
      type: Function,
    },
    textRight: {
      type: String,
    }
  },
});
</script>
<style lang="scss" scoped>
.title {
  position: relative;
  margin-left: 8px;
  color: #333;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 20px;
  &::before {
    content: " ";
    display: inline-block;
    position: absolute;
    top: 10%;
    left: -10px;
    width: 5px;
    height: 80%;
    background: #4197ff;
  }
  span {
    font-weight: 400;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    color: #4197ff;
    // &:hover {
    //   color: #4197ff;
    // }
  }
}
</style>