赞
踩
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
}
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。