Skip to content

Commit

Permalink
Merge pull request #1036 from Carlmac/feat-tooltips-master
Browse files Browse the repository at this point in the history
feat(member-selector): 维护人员文本的tooltips
  • Loading branch information
jinquantianxia authored Oct 18, 2024
2 parents b38fb33 + 2362ece commit 2afdfe0
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<div class="edit-wrapper">
<div class="edit-content">
<slot>
<template v-if="displayValue.length">
<span v-for="(item, index) in displayValue" :key="index" class="member-item">
{{ displayValue.length > 1 && index !== displayValue.length - 1 ? `${item},` : item }}
<template v-if="membersText">
<span class="member-item" v-bk-tooltips="{ content: membersText, placement: 'top-start' }">
{{ membersText }}
</span>
</template>
<template v-else>--</template>
Expand Down Expand Up @@ -170,6 +170,10 @@ const isEditMode = computed(() => {
return props.mode === 'edit';
});
const membersText = computed(() => {
return displayValue.value.join(', ');
});
watch(
() => props.content,
(payload: any[]) => {
Expand Down Expand Up @@ -219,13 +223,12 @@ onBeforeMount(() => {
line-height: 32px;
.member-item {
display: inline-block;
// padding: 0 10px;
// margin: 2px 0 2px 6px;
line-height: 32px;
// border-radius: 2px;
// background: #f0f1f5;
font-size: 12px;
width: calc(100% - 25px);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
i {
font-size: 18px;
Expand Down

0 comments on commit 2afdfe0

Please sign in to comment.