# HighLight 文本高亮
# 安装
$ npm i @hui-pro/highlight -D
# 或者
$ yarn add @hui-pro/highlight --dev
# 引入
import highlight from '@hui-pro/highlight';
import '@hui-pro/highlight/theme/index.scss';
Vue.use(highlight);
# 基础用法
<h-highlight :highlight-key="searchText">
There were injuries alleged in three cases in 2015, and a fourth incident in
September, according to the safety recall report. After meeting with US
regulators in October, the firm decided to issue a voluntary recall.
</h-highlight>
<script>
export default {
data() {
return {
searchText: 'in'
};
}
};
</script>
# API
# Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
highlight-key | 高亮字符 | String/Number | - | - |
color | 高亮颜色,默认为主题色 | String | - | - |