fix : 修复部门分管领导回显,需求上报排版
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
placement="bottom-start"
|
||||
:disabled="isShow"
|
||||
>
|
||||
<div :class="lines?'content-lines':'content'" :style="{width: props.width}" @mouseover="isShowTooltip">
|
||||
<div :class="lines?'content-lines':textAlign=='left'?'left-content':'content'" :style="{width: props.width+'px'}" @mouseover="isShowTooltip">
|
||||
<span ref="contentRef">
|
||||
<slot name="content">{{ props.content }}</slot>
|
||||
</span>
|
||||
@@ -25,15 +25,26 @@ const props = defineProps({
|
||||
lines: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
textAlign: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
})
|
||||
const contentRef = ref()
|
||||
const isShow = ref(false)
|
||||
const isShowTooltip = () => {
|
||||
isShow.value = props.width > contentRef.value.offsetWidth;
|
||||
isShow.value = parseInt(props.width) > contentRef.value.offsetWidth;
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
<style scoped>
|
||||
.left-content{
|
||||
width: 45px;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.content {
|
||||
width: 45px;
|
||||
text-align: center;
|
||||
|
||||
Reference in New Issue
Block a user