mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(form-item): Fix form-item props undefined bug (#888)
Co-authored-by: bastarder <jie.qian@blockheaders.com>
This commit is contained in:
@@ -53,9 +53,14 @@ export function getPropByPath(obj: any, path: string, strict: boolean): {
|
||||
for (i; i < keyArr.length - 1; i++) {
|
||||
if (!tempObj && !strict) break
|
||||
const key = keyArr[i]
|
||||
tempObj = tempObj?.[key]
|
||||
if (!tempObj && strict) {
|
||||
throw new Error('please transfer a valid prop path to form item!')
|
||||
|
||||
if (key in tempObj) {
|
||||
tempObj = tempObj[key]
|
||||
} else {
|
||||
if (strict) {
|
||||
throw new Error('please transfer a valid prop path to form item!')
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user