this.searchValue为输入框的值
createKeywordHtml_content(data) {
if (data === undefined) {
return data;
}
if (typeof data !== 'string') {
data = String(data)
}
let value = data.replace(this.searchValue, '<span style="color:#FF5555">$&</span>');
return value
},
<el-table-column prop="date" label="日期" width="180">
<template slot-scope="scope">
<span v-html="createKeywordHtml_content(scope.row.date)">日期</span><!-- v-html="createKeywordHtml_content(scope.row[column.field])" -->
</template>
</el-table-column>
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » 输入框输入值之后,检索表格中是否存在输入框中的值,存在就让当前文字为红色
发表评论 取消回复