<template>
  <div>
    <img @click="cancel" class="icon" src="/img/icon/back1.png" alt="极度证券">
  </div>
</template>
<script>
export default {
  props: ['back'],
  methods: {
    cancel() {
      if (this.back) {
        this.$emit(this.back)
        return
      }
      if (window.history.length <= 2) {
        this.$router.replace('/')
      } else {
        this.$router.back()
      }
    }
  }
}
</script>
<style lang="less" scoped>
.icon {
  width: 8px;
  display: block;
  cursor: pointer;
}
</style>