fix(render): find => filter
This commit is contained in:
parent
bab76e004d
commit
eca3368152
2 changed files with 3 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ function renderNameLink (vm) {
|
||||||
if (isPrimitive(vm.config.nameLink)) {
|
if (isPrimitive(vm.config.nameLink)) {
|
||||||
el.setAttribute('href', nameLink)
|
el.setAttribute('href', nameLink)
|
||||||
} else if (typeof nameLink === 'object') {
|
} else if (typeof nameLink === 'object') {
|
||||||
const match = Object.keys(nameLink).find(key => path.indexOf(key) > -1)
|
const match = Object.keys(nameLink).filter(key => path.indexOf(key) > -1)[0]
|
||||||
|
|
||||||
el.setAttribute('href', nameLink[match])
|
el.setAttribute('href', nameLink[match])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ function updatePlaceholder (text, path) {
|
||||||
if (typeof text === 'string') {
|
if (typeof text === 'string') {
|
||||||
$input.placeholder = text
|
$input.placeholder = text
|
||||||
} else {
|
} else {
|
||||||
const match = Object.keys(text).find(key => path.indexOf(key) > -1)
|
const match = Object.keys(text).filter(key => path.indexOf(key) > -1)[0]
|
||||||
$input.placeholder = text[match]
|
$input.placeholder = text[match]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +133,7 @@ function updateNoData (text, path) {
|
||||||
if (typeof text === 'string') {
|
if (typeof text === 'string') {
|
||||||
NO_DATA_TEXT = text
|
NO_DATA_TEXT = text
|
||||||
} else {
|
} else {
|
||||||
const match = Object.keys(text).find(key => path.indexOf(key) > -1)
|
const match = Object.keys(text).filter(key => path.indexOf(key) > -1)[0]
|
||||||
NO_DATA_TEXT = text[match]
|
NO_DATA_TEXT = text[match]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue