# getUrlParam(name, [url]) ⇒ string
获取url参数
Returns: string
-
url参数name对应的值
Author: liukun 919590347@qq.com
Param | Type | Default | Description |
---|---|---|---|
name | string | url参数 | |
[url] | string | "window.location.href" | 可选,url |
Example
import { getUrlParam } from '@wont/utils'
getUrlParam('id', 'http://localhost:8088/#/index?type=hash&id=8080&index=0') // returns '8080'