mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-21 01:02:59 +08:00
fix(hooks): [empty-values] warning on modifying computead value (#16508)
* fix(hooks): [empty-values] warning on modifying computead value * chore: update * fix: update * fix: update
This commit is contained in:
parent
84f49de955
commit
e4306b2eb1
@ -1,4 +1,4 @@
|
||||
import { computed } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { useGlobalConfig } from '@element-plus/components/config-provider'
|
||||
import { buildProps, debugWarn, isFunction } from '@element-plus/utils'
|
||||
|
||||
@ -27,8 +27,10 @@ export const useEmptyValues = (
|
||||
props: ExtractPropTypes<typeof useEmptyValuesProps>,
|
||||
defaultValue?: null | undefined
|
||||
) => {
|
||||
const config = useGlobalConfig()
|
||||
config.value = config.value || {}
|
||||
let config = useGlobalConfig()
|
||||
if (!config.value) {
|
||||
config = ref({})
|
||||
}
|
||||
|
||||
const emptyValues = computed(
|
||||
() => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES
|
||||
|
Loading…
Reference in New Issue
Block a user