Skip to content

Commit eca3368

Browse files
committed
fix(render): find => filter
1 parent bab76e0 commit eca3368

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/render/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function renderNameLink (vm) {
7070
if (isPrimitive(vm.config.nameLink)) {
7171
el.setAttribute('href', nameLink)
7272
} else if (typeof nameLink === 'object') {
73-
const match = Object.keys(nameLink).find(key => path.indexOf(key) > -1)
73+
const match = Object.keys(nameLink).filter(key => path.indexOf(key) > -1)[0]
7474

7575
el.setAttribute('href', nameLink[match])
7676
}

src/plugins/search/component.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function updatePlaceholder (text, path) {
124124
if (typeof text === 'string') {
125125
$input.placeholder = text
126126
} else {
127-
const match = Object.keys(text).find(key => path.indexOf(key) > -1)
127+
const match = Object.keys(text).filter(key => path.indexOf(key) > -1)[0]
128128
$input.placeholder = text[match]
129129
}
130130
}
@@ -133,7 +133,7 @@ function updateNoData (text, path) {
133133
if (typeof text === 'string') {
134134
NO_DATA_TEXT = text
135135
} else {
136-
const match = Object.keys(text).find(key => path.indexOf(key) > -1)
136+
const match = Object.keys(text).filter(key => path.indexOf(key) > -1)[0]
137137
NO_DATA_TEXT = text[match]
138138
}
139139
}

0 commit comments

Comments
 (0)