|
|
@@ -109,11 +109,15 @@ export default defineComponent({
|
|
|
});
|
|
|
}
|
|
|
function handleSearch(value: string) {
|
|
|
- const findResult = myFriends.value.find((e) => String(e.frienduserid).includes(value));
|
|
|
- if (findResult) {
|
|
|
- searchFriend.value = [findResult];
|
|
|
+ if (value) {
|
|
|
+ const findResult = myFriends.value.filter((e) => String(e.frienduserid).includes(value));
|
|
|
+ if (findResult.length) {
|
|
|
+ searchFriend.value = findResult;
|
|
|
+ } else {
|
|
|
+ queryMyFriend(value);
|
|
|
+ }
|
|
|
} else {
|
|
|
- queryMyFriend(value);
|
|
|
+ searchFriend.value = myFriends.value;
|
|
|
}
|
|
|
}
|
|
|
|