直接统计字符个数,然后js截取 let newValue = value.substring(0,100)+"..."; let htmlValue = newValue + `<span onclick="alert('ok')">阅读全文</span>