index.vue 612 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div class="text-copy-part">
  3. <div class="text-part-text">{{ text }}</div>
  4. <el-tooltip effect="dark" content="复制" placement="top">
  5. <el-icon color="#409eff" @click="copy(text)"><ele-CopyDocument /></el-icon>
  6. </el-tooltip>
  7. </div>
  8. </template>
  9. <script lang="ts" setup>
  10. import copy from '/@/utils/copy.ts'
  11. defineProps({ text: String })
  12. </script>
  13. <style lang="scss" scoped>
  14. .text-copy-part {
  15. display: flex;
  16. align-items: center;
  17. .text-part-text {
  18. overflow: hidden;
  19. white-space: nowrap;
  20. text-overflow: ellipsis;
  21. }
  22. .el-icon {
  23. cursor: pointer;
  24. margin-left: 4px;
  25. }
  26. }
  27. </style>