Home > @dinofe/xt-core > getQuery
# getQuery() function
获取url中参数值
Signature:
export declare function getQuery(str: string, a: string): string | undefined;
# Parameters
| Parameter | Type | Description | 
|---|---|---|
| str | string | url链接 | 
| a | string | 要获取参数的key | 
Returns:
string | undefined
url链接中key对应的值
# Remarks
使用 & = 符号进行切割,不会进行 URL 反编码
# Example
import { getQuery } from '@dinofe/xt-core/common'
getQuery('https://www.foo.com?a=aaa&b=bbb', a) // aaa
