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>

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部