<template>
  <div class="tit-box" :style="width ? `${width}px` : '100%'">
    <div v-if="title">{{ title }}</div>
    <div v-else>
      <slot name="title"></slot>
    </div>
    <div>
      <slot></slot>
    </div>
  </div>
</template>

<script>

export default {
  data() {
    return {
    };
  },
  props: {
    title: {
      type: String,
      default: ""
    },
    width: {
      type: Number,
      default: 0
    }
  },
  created() {

  },
  methods: {}
};
</script>
<style lang="scss" scoped>
.tit-box {
  position: absolute;
  top: 0.14rem;
  left: 0.6rem;
  box-sizing: border-box;
  // margin: 0.14rem 0 0 0.38rem;
  width: calc(100% - 0.6rem - 0.22rem);
  height: 0.34rem;
  display: flex;
  justify-content: space-between;

  &>div:nth-child(1) {
    font-size: 0.18rem;
    color: rgba($color: #fff, $alpha: 0.8);
    font-family: Microsoft YaHei;
    font-weight: 400;
  }
}
</style>
