Skip to content

Commit

Permalink
fix(render): find => filter
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed May 22, 2017
1 parent bab76e0 commit eca3368
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/render/index.js
Expand Up @@ -70,7 +70,7 @@ function renderNameLink (vm) {
if (isPrimitive(vm.config.nameLink)) {
el.setAttribute('href', nameLink)
} 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])
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/search/component.js
Expand Up @@ -124,7 +124,7 @@ function updatePlaceholder (text, path) {
if (typeof text === 'string') {
$input.placeholder = text
} 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]
}
}
Expand All @@ -133,7 +133,7 @@ function updateNoData (text, path) {
if (typeof text === 'string') {
NO_DATA_TEXT = text
} 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]
}
}
Expand Down

0 comments on commit eca3368

Please sign in to comment.