当前位置:网站首页>RN search highlight
RN search highlight
2022-07-27 22:28:00 【When the wind blows, the clouds fly】
Highlighting search keywords is a common feature in the front end , Let's share briefly today , The code is as follows :
search = (text) => {
let list = [' Melon seed used car ', " I'm a melon seed used car, melon seed used car ", " Used car melon seeds "];
const list_ = list.map(item => {
const ui = []
const newArr = item.split(text)
for (let i = 0; i < newArr.length; i++) {
const v = newArr[i]
if (i!== 0) {
ui.push(<Text style={
[y.color('red')]}>{
text}</Text>)
}
ui.push(<Text>{
v}</Text>)
}
return <View style={
[y.udr]}>{
ui}</View>
})
this.setState({
result: list_
})
}
边栏推荐
- Pythia: Facebook's latest open source visual and language multitasking learning framework
- 7行代码让B站崩溃3小时
- Cocos: simple application of ccpdistance function and the function of eyeball rotating in orbit with fingers
- 华能福建公司与华为数字能源深化战略合作,共建低碳智能县域
- 2022 / July daily report
- Learn the use principle and core idea of thread pool from the source code
- 每条你收藏的资讯背后,都离不开TA
- 2022 2nd cyber edge cup cyber security competition Web
- Massive data TOPK problem
- Multi tenant SaaS cloud platform framework
猜你喜欢
![[question 21] idiom Solitaire (Beijing Institute of Technology / Beijing University of Technology / programming methods and practice / primary school)](/img/dd/5ef46cff3988db57bfaf6fe925a0e0.jpg)
[question 21] idiom Solitaire (Beijing Institute of Technology / Beijing University of Technology / programming methods and practice / primary school)

matlab 绘制三坐标(轴)图

Multi tenant SaaS cloud platform framework

Starrocks community structure comes out, waiting for you to upgrade!

Kubernetes二进制部署——理论部分

Leetcode383 ransom letter

An2021 software installation and basic operation (new file / export)

Starfish Os X MetaBell战略合作,元宇宙商业生态更进一步

项目管理工具禅道

Temperature relay
随机推荐
项目管理工具禅道
8000字讲透OBSA原理与应用实践
SQL注入 Less26a(布尔盲注)
ApacheSpark-命令执行(CVE-2022-33891) 漏洞复现
[untitled]
SQL注入 Less29(参数污染绕过WAF)
视频直播源码,uni-app实现广告滚动条
Monitor the running of server jar and restart script
极化继电器
dBm和Vpp以及Vpeak的关系
jumpserver学习
leetcode15--三数之和
A lock faster than read-write lock. Don't get to know it quickly
Vs2019 release mode debugging: this expression has side effects and will not be evaluated.
How to buy stocks on mobile phones? Is it safe to open an account
【二叉树】统计二叉树中好节点的数目
直播app系统源码,上下叠层样式的轮播图
If demand splitting is as simple as cutting a cake | agile practice
SQL injection less26a (Boolean blind injection)
Alibaba Senior Software Testing Engineer recommends testers to learn -- Introduction to security testing