mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 03:08:21 +08:00
fix(components): [select] equal objects cannot destroy instances (#17214)
fix(components): [select] support value of type of object closed #17209 Co-authored-by: zhangdong <a80369@gree.com.cn> Co-authored-by: qiang <qw13131wang@gmail.com>
This commit is contained in:
parent
79938178dd
commit
b29d82f4e7
@ -1,6 +1,6 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import { computed, getCurrentInstance, inject, toRaw, watch } from 'vue'
|
import { computed, getCurrentInstance, inject, toRaw, watch } from 'vue'
|
||||||
import { get, isEqual } from 'lodash-unified'
|
import { get } from 'lodash-unified'
|
||||||
import { ensureArray, escapeStringRegexp, isObject } from '@element-plus/utils'
|
import { ensureArray, escapeStringRegexp, isObject } from '@element-plus/utils'
|
||||||
import { selectGroupKey, selectKey } from './token'
|
import { selectGroupKey, selectKey } from './token'
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ export function useOption(props, states) {
|
|||||||
(val, oldVal) => {
|
(val, oldVal) => {
|
||||||
const { remote, valueKey } = select.props
|
const { remote, valueKey } = select.props
|
||||||
|
|
||||||
if (!isEqual(val, oldVal)) {
|
if (val !== oldVal) {
|
||||||
select.onOptionDestroy(oldVal, instance.proxy)
|
select.onOptionDestroy(oldVal, instance.proxy)
|
||||||
select.onOptionCreate(instance.proxy)
|
select.onOptionCreate(instance.proxy)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user