react-string-replace:一种使用React组件安全地进行字符串替换的简单方法

时间:2021-05-11 16:01:44
【文件属性】:
文件名称:react-string-replace:一种使用React组件安全地进行字符串替换的简单方法
文件大小:50KB
文件格式:ZIP
更新时间:2021-05-11 16:01:44
react react-components string-manipulation JavaScript React字符串替换 一种使用React组件安全地进行字符串替换的简单方法 又名将字符串转换为React组件的数组 安装 $ npm install --save react-string-replace 用法 简单的例子 const reactStringReplace = require ( 'react-string-replace' ) reactStringReplace ( 'whats your name' , 'your' , ( match , i ) => ( < span> { match } < / span > ) ) ; // => [ 'whats ', your, ' name' ] 更现实的例子 通过在跨度标签中将字符串中的所有数字突出显示,以突出显示它们: reactStringReplace ( 'Apt 111,
【文件预览】:
react-string-replace-master
----circle.yml(36B)
----.eslintrc(28B)
----.gitattributes(12B)
----yarn.lock(130KB)
----test.js(5KB)
----.npmignore(8B)
----license(1KB)
----example()
--------server.js(2KB)
--------webpack.config.js(969B)
--------README.md(213B)
--------.gitignore(64B)
--------index.js(1KB)
--------package.json(724B)
----index.d.ts(286B)
----.gitignore(27B)
----index.js(2KB)
----readme.md(4KB)
----package.json(1KB)

网友评论