Commit ec2053b9 authored by 陈明豪's avatar 陈明豪

bug修改

parent ebd5ba7e
<template>
<el-tooltip :content="text" placement="top-start" :disabled="tipDisabled">
<el-input
v-model="text"
readonly="true"
disabled="true"
:style="{width: width}"
@mouseover.native="inputOnMouseOver($event)"
/>
</el-tooltip>
</template>
<script>
export default {
name: 'InputTips',
props: {
// 输入框内容
text: {
type: String,
default: null
},
// 保留的字符长度
saveLength: {
type: Number,
default: 9999999
},
// 输入框宽度
width: {
type: String,
default: '100%'
}
},
data() {
return {
tipContent: null,
tipDisabled: false
}
},
watch: {},
created() {
},
methods: {
inputOnMouseOver(event) {
const target = event.target
// 判断是否开启tooltip功能
if (target.offsetWidth < target.scrollWidth) {
this.tipDisabled = false
} else {
this.tipDisabled = true
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-overflow: ellipsis
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment