-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from RosyrRais/main
pref:表格文字溢出处理 复制链接反馈增加
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<div class="relative cursor-default"> | ||
<div class="overflowText text-slate-700" @click="showModal">{{ text }}</div> | ||
<div class="overflowModal" @mouseout="hideModal">{{ text }}</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
defineProps<{ | ||
text: string | ||
}>(); | ||
const showModal = (e: MouseEvent) => { | ||
console.log("debug:1") | ||
const et = (e.target as HTMLElement).nextElementSibling as HTMLElement; | ||
et.style.display = "block"; | ||
} | ||
const hideModal = (e: MouseEvent) => { | ||
const et = e.target as HTMLElement; | ||
et.style.display = "none"; | ||
} | ||
</script> | ||
|
||
<style> | ||
.overflowText{ | ||
max-width: 230px; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
} | ||
.overflowModal { | ||
max-width: 500px; | ||
position: absolute; | ||
left: 0; top: 0; | ||
padding: 8px 16px; | ||
border: 2px solid rgb(176, 176, 176); | ||
border-radius: 3px; | ||
background-color: white; | ||
word-wrap: break-word; | ||
z-index: 5; | ||
display: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters