# wx.offBeforePageUnload(function listener)

> 基础库 3.5.5 开始支持，低版本需做[兼容处理](1003706)。

> __小程序插件__：支持，需要小程序基础库版本不低于 [3.5.5](1003706)
> 
> __微信 鸿蒙 OS 版__：支持

## 功能描述

移除路由事件的监听函数

## 参数

### function listener

onBeforePageUnload 传入的监听函数。不传此参数则移除所有监听函数。

## 示例代码
```js
const listener = function (res) { console.log(res) }

wx.onBeforePageUnload(listener)
wx.offBeforePageUnload(listener) // 需传入与监听时同一个的函数对象
```
