# DownloadTask.offProgressUpdate(function listener)
移除下载进度变化事件的监听。
# 支持情况
| 项 | 说明 |
|---|---|
| 兼容性 | 兼容微信 |
# 语法
downloadTask.offProgressUpdate(function listener)
# 参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| listener | function | 是 | 要移除的监听函数,必须与注册时传入的函数引用相同 |
# 返回值
void。
# 注意事项
- 当前版本存在已知问题:源码中取消监听时未传入函数引用,实际可能无法按预期移除指定监听函数。
# 示例代码
const task = mt.downloadFile({ url: 'https://example.com/file.zip' })
const handler = (res) => { console.log(res.progress) }
task.onProgressUpdate(handler)
task.offProgressUpdate(handler)
# 与微信差异
无差异(行为与微信小游戏一致)。