Newer
Older
VueSharedPrinting / src / components / nav.vue
<template>
  <div class="nav flex-between">
    <div class="back flex-center" @click="_goHome()">
      <img src="../assets/demo10.png" alt="" />
      返回上一页
    </div>
    <div :class="['name', 'flex-center', { 'vertical-title-margin': isVertical }]">{{ title }}</div>
    <div class="type" v-if="type">【{{ type }}】</div>
  </div>
</template>

<script>
export default {
  name: 'nav',
  inject: ['title', 'type'],
  data() {
    return {
      isVertical: false
    }
  },
  methods: {
    _goHome() {
      window.history.back()
      // this.quit()
      // this.$router.push({
      //   name: 'device'
      // })
    }
  },
  created() {
    this.isVertical = this.cite.isVertical
  }
}
</script>

<style scoped lang="less">
.nav {
  height: 10.88rem;
  padding: 0 5.56rem 0 2.06rem;
  position: relative;
  font-size: 34px;
  font-weight: bold;
  color: #323232;
  line-height: 48px;
  .back {
    width: 21.88rem;
    height: 6.44rem;
    background: #ffffff;
    box-shadow: 0rem 0.31rem 0.63rem 0.06rem rgba(0, 0, 0, 0.14);
    border-radius: 1.63rem;
    cursor: pointer;
    img {
      width: 2.65rem;
      margin-right: 1.25rem;
    }
  }
  .name {
    position: absolute;
    height: 100%;
    font-size: 3.5rem;
    font-weight: 400;
    color: #323232;
    line-height: 3.69rem;
    left: 50%;
    width: 50rem;
    margin-left: -25rem;
  }
}
.vertical-title-margin {
  margin-left: -11rem !important;
  font-size: 2.5rem !important;
}
</style>