Preview Updated 2026-05-10

Highlight

Highlight matched keywords inside long text. Useful for search result lists and keyword markers.

Basic usage

text is the source text, match can be a string or a regex; string mode is case-insensitive by default.

ChuFix UI 是一个 Vue 3 与 React 双框架同源的基础组件库;CSS 变量主题、cf-* 类名前缀,纯 HTML/JS 项目也能直接用。

<CfHighlight :text="text" :match="q" />
<CfHighlight text={text} match={q} />

API

PropTypeDefaultDescription
textstringSource text
matchstring | RegExpKeyword or regex; no highlight when empty
caseSensitivebooleanfalseWhether to be case-sensitive in string mode

反馈与讨论

Highlight · Discussion

0
0 / 600
一键发送
正在加载评论...