回答編集履歴
1
typo
answer
CHANGED
@@ -43,15 +43,10 @@
|
|
43
43
|
},
|
44
44
|
watch: {
|
45
45
|
keyword: function(newValue, oldValue) {
|
46
|
-
this.filteredUsers = [];
|
47
|
-
for (var user of this.users) {
|
48
|
-
if (
|
49
|
-
user.name.includes(newValue) ||
|
50
|
-
user.email.includes(newValue)
|
51
|
-
) {
|
52
|
-
|
46
|
+
this.filteredUsers = this.users.filter(
|
47
|
+
user =>
|
48
|
+
user.name.includes(newValue) || user.email.includes(newValue)
|
53
|
-
|
49
|
+
);
|
54
|
-
}
|
55
50
|
}
|
56
51
|
}
|
57
52
|
});
|