用法
removeQueryParam 函数用于删除 URL 的指定查询参数。
import { removeQueryParam } from '@movk/core'
removeQueryParam('https://example.com?page=1&sort=name', 'page')
// 'https://example.com?sort=name'
removeQueryParam('https://example.com?page=1', 'page')
// 'https://example.com'
API
removeQueryParam(url, key)
删除 URL 的指定查询参数。
参数
url
string required
URL 字符串。
key
string required
要删除的参数名。
返回值
返回值
string
新的 URL 字符串。
Changelog
No recent changes