mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-12 10:45:10 +08:00
fix(option): selectemitter was not turned off when it was destroyed (#2450)
This commit is contained in:
parent
6305f7af80
commit
f6b17cb79a
@ -3,6 +3,7 @@ import {
|
||||
computed,
|
||||
getCurrentInstance,
|
||||
watch,
|
||||
onBeforeUnmount,
|
||||
} from 'vue'
|
||||
import { getValueByPath, escapeRegexpString } from '@element-plus/utils/util'
|
||||
import {
|
||||
@ -108,6 +109,10 @@ export function useOption(props, states) {
|
||||
// Emitter
|
||||
select.selectEmitter.on(selectEvents.queryChange, queryChange)
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
select.selectEmitter.off(selectEvents.queryChange, queryChange)
|
||||
})
|
||||
|
||||
return {
|
||||
select,
|
||||
currentLabel,
|
||||
|
Loading…
Reference in New Issue
Block a user