<template>
  <el-tooltip :content="txt" placement="top">
    <span>{{ omitTxt }}</span>
  </el-tooltip>
</template>

<script>
export default {
  name: 'BaseTooltip',
  props: {
    txt: {
      type: String,
      default: ''
    }
  },

  computed: {
    omitTxt() {
      let str = this.txt;
      return str.length > 20 ? str.slice(0, 20) : str;
    }
  },

  methods: {}
};
</script>

<style lang="scss" scoped></style>
