填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

ParamMap

A map that provides access to the required and optional parameters specific to a route. The map supports retrieving a single value with get() or multiple values with getAll().

      
      interface ParamMap {
  keys: string[]
  has(name: string): boolean
  get(name: string): string | null
  getAll(name: string): string[]
}
    

参见

属性

属性说明
keys: string[]只读

Names of the parameters in the map.

方法

Reports whether the map contains a given parameter.

has(name: string): boolean
      
      has(name: string): boolean
    
参数
name string

The parameter name.

返回值

boolean: True if the map contains the given parameter, false otherwise.

Retrieves a single value for a parameter.

get(name: string): string | null
      
      get(name: string): string | null
    
参数
name string

The parameter name.

返回值

string | null: The parameter's single value, or the first value if the parameter has multiple values, or null when there is no such parameter.

Retrieves multiple values for a parameter.

getAll(name: string): string[]
      
      getAll(name: string): string[]
    
参数
name string

The parameter name.

返回值

string[]: An array containing one or more values, or an empty array if there is no such parameter.