<template>
  <el-tooltip
    class="tooltip"
    effect="dark"
    placement="top"
  >
    <template #content>
      <span class="tooltip-content">{{text}}</span>
    </template>
    <div class="overflow-text" :style="{width}">
      {{text}}
      </div>
  </el-tooltip>
</template>
<script>
export default {
  name: 'overflow-text',
  props: {
    text: {
      type: String,
      default: ''
    },
    width: {
      type: String,
      default: '200px'
    }
  }
}
</script>
<style lang="less" scoped>
.tooltip-content{
  display: inline-block;
  max-width: 300px;
}
  .overflow-text{
    overflow : hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
</style>
