Bread.vue 891 Bytes
<template>
  <div class="bread">
    <div>
      <slot name="title"></slot>
      <span class="btn">
        <slot name="btn"></slot>
      </span>
    </div>
    <el-button
      v-if="isShowBack"
      type="text"
      style="margin-right:50px;"
      @click="handleClick"
      >返回</el-button
    >
  </div>
</template>
<script>
export default {
  name: 'Bread',
  props: {
    isShowBack: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleClick() {
      this.$router.go(-1)
    }
  }
}
</script>
<style lang="scss" scoped>
.bread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  border-left: 5px solid #3f51b5;
  padding-left: 15px;
  font-size: 16px;
  font-weight: 700;
  .btn {
    display: inline-block;
    color: #3f51b5;
    margin-left: 15px;
    font-size: 20px;
    cursor: pointer;
  }
}
</style>