定位器
负责提供客户端上的url变化事件
还可以通过pushState添加历史记录,修改location
- Source:
Methods
(static) redirect(pathnon-null, querynullable) → {boolean}
对当前页面进行跳转操作
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
string | 跳转到的新地址 | |
query |
Object |
<nullable> |
query参数 |
- Source:
Fires:
- module:events~locator.event:redirect
Returns:
是否是pushState跳转
- Type
- boolean
(static) start() → {module:locator}
开始侦听浏览器的前进/后退事件
- Source:
Returns:
- Type
- module:locator
(static) stop() → {module:locator}
停止浏览器的前进/后退事件
- Source:
Returns:
- Type
- module:locator