<template>
  <div class="bi-log-button">
    <el-button
      v-if="type === 'button'"
      type="text"
      @click="handleLog"
    >日志</el-button>
    <span
      v-if="type === 'text'"
      type="text"
      @click="handleLog"
    >日志</span>
  </div>
</template>

<script>
export default {
  name: 'BiLogButton',
  props: {
    type: {
      type: String,
      default: 'text'
    },
    logId: {
      type: String,
      default: ''
    },
    logModel: {
      type: String,
      default: ''
    }
  },

  methods: {
    handleLog() {
      this.$root.$emit('biLogEvent', { id: this.logId, model: this.logModel })
    }
  }
}
</script>
<style lang="scss" scoped>
.bi-log-button {
  & > span {
    display: block;
  }
  .el-button,
  span {
    width: 100%;
    // height: 30px;
    // line-height: 30px;
    // padding: 0 17px;
    text-align: left;
    color: inherit;
    font-weight: inherit;
  }
}
</style>
