環(huán)境, vue iview table組件目標(biāo), 高亮一段內(nèi)容中的部分關(guān)鍵字.嘗試1,操作:從后臺(tái)拿到數(shù)據(jù)庫(kù)迭代, 替換對(duì)應(yīng)的關(guān)鍵字.結(jié)果, 可以高亮, 但是其他用到data的地方也會(huì)跟著變.2,操作,使用render 函數(shù)在table中替換結(jié)果, 顯示代碼不現(xiàn)實(shí)高亮render 這么寫的.{ title: '聯(lián)系郵箱', key: 'email', render: (h, params) => { return h('span', { }, params.row.email.replace("test", '<span style="background: #ffff00;">test</span>')); } },顯示如下:問題, 怎么使用render 實(shí)現(xiàn)其中test高亮顯示.
在vue中, 怎么使用render函數(shù)實(shí)現(xiàn)關(guān)鍵字高亮?
慕碼人8056858
2018-12-20 19:11:03