25 lines
514 B
Markdown
25 lines
514 B
Markdown
---
|
|
title: 字符串相关
|
|
toc: content
|
|
---
|
|
|
|
## 代码演示
|
|
|
|
## getValueByUrl
|
|
|
|
通过 url 返回想要的参数
|
|
|
|
```js
|
|
import { getValueByUrl } from '@zhst/func'
|
|
|
|
const value = getValueByUrl('a', 'http://localhost:30058?a=123&token=asdfasdfsdf')
|
|
// --> 123
|
|
const value2 = getValueByUrl('a', '?a=123&token=asdfasdfsdf')
|
|
// --> 123
|
|
const value3 = getValueByUrl('a', 'a=123&token=asdfasdfsdf')
|
|
// --> 123
|
|
```
|
|
|
|
<code src="./demo/getValueByUrl.tsx">调试台</code>
|
|
<code src="./demo/pxTorem.tsx">px 转 rem</code>
|