my.offError
Updated at:
Removes the listener function for Mini Program error events.
Description
my.offError
Removes the listener function for a Mini Program error event.
Input parameter
Function listener
The Mini Program error callback function to remove.
Sample code
my.offError(Function listener)
Page({
onLoad() {
my.onError(this.errorHandler);
},
errorHandler(res) {
console.log('onError error', res.error);
console.log('onError stack', res.stack);
},
onUnload() {
my.offError(this.errorHandler)
}
})
Is this page helpful?