<template>
  <span v-if="text.length < length">{{ text }}</span>
  <a-tooltip v-else>
    <span slot="title">{{ text }}</span>
    <span>{{ text.substring(0, length - 1) }}......</span>
  </a-tooltip>
</template>

<script>
export default {
  name: 'TrimTextTail',
  props: {
    text: {
      type: String,
      default: ''
    },
    length: {
      type: Number,
      default: 10
    }
  }
}
</script>
