当前位置:   article > 正文

控制tooltip开启关闭以及超过字符省略号显示_c# tooltip 关闭显示

c# tooltip 关闭显示

vue:

<el-descriptions-item >
<template slot="label"> {{ $t("operating.correspondingreasons") }}</template>
<div class="descriptionsStyle">
<el-tooltip :disabled="isShowTooltip" class="item" effect="dark" :content="`${reasonForm.operationContents}`" placement="top-end">
<div @mouseover="operationContentsShow()">
<span >{{reasonForm.operationContents | operationContentsValue }}</span>
</div>
</el-tooltip>
</div>
</el-descriptions-item>

return:

isShowTooltip:false,

//超过字符省略号显示

filters:

operationContentsValue(operationContents){
if (!operationContents) return '';
if (operationContents.length > 250) {
return operationContents.slice(0, 250) + "...";
}
return operationContents;
},

methods:

operationContentsShow(){
var MaxLength = this.reasonForm.length
var lengths = 250
if(MaxLength>lengths){
this.isShowTooltip =true
}else{
this.isShowTooltip =false
}
},

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/120440
推荐阅读
相关标签
  

闽ICP备14008679号