提交 d6d1a649 编写于 作者: D DCloud_LXH

fix: removeSubscribe add pageId param fixed #3187

上级 9148485d
......@@ -48,11 +48,11 @@ function addSubscribe(
)
}
function removeSubscribe(name: string) {
function removeSubscribe(name: string, pageId?: number) {
if (!name) {
return
}
unregisterViewMethod(getCurrentPageId(), name)
unregisterViewMethod(pageId || getCurrentPageId(), name)
}
export function useSubscribe<Res = any>(
......@@ -76,7 +76,7 @@ export function useSubscribe<Res = any>(
}
})
onBeforeUnmount(() => {
removeSubscribe(name || normalizeEvent(vm)!)
removeSubscribe(name || normalizeEvent(vm)!, pageId)
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册