1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00

fix removeListener index

This commit is contained in:
yoanngueny 2021-06-30 11:07:15 +02:00
parent 89b649be12
commit 3fd6dc3e05

View File

@ -238,7 +238,7 @@ export default defineComponent({
removeListener(type: string, cb: {(e?: any): void}) { removeListener(type: string, cb: {(e?: any): void}) {
const callbacks = this.getCallbacks(type) const callbacks = this.getCallbacks(type)
const index = callbacks.indexOf(cb) const index = callbacks.indexOf(cb)
if (index) callbacks.splice(index, 1) if (index != -1) callbacks.splice(index, 1)
}, },
getCallbacks(type: string) { getCallbacks(type: string) {