mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
fix: 选择姓名时定位到成员即可添加
This commit is contained in:
parent
2aef22640b
commit
1925d94b7a
@ -91,15 +91,8 @@ class UsernameAutoComplete extends Component {
|
|||||||
dataSource: userList
|
dataSource: userList
|
||||||
});
|
});
|
||||||
if (userList.length) {
|
if (userList.length) {
|
||||||
userList.forEach((item) => {
|
// 每次取回搜索值后,没选择时默认选择第一位
|
||||||
if (item.username === this.state.changeName) {
|
this.changeState(userList[0].id, userList[0].username);
|
||||||
// 每次取回搜索值后,没选择时默认选择第一位
|
|
||||||
this.changeState(userList[0].id, userList[0].username);
|
|
||||||
} else {
|
|
||||||
// 有候选词但没有对应输入框中的字符串,此时应清空候选 uid 和 username
|
|
||||||
this.changeState(-1, '');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// 如果没有搜索结果,则清空候选 uid 和 username
|
// 如果没有搜索结果,则清空候选 uid 和 username
|
||||||
this.changeState(-1, '');
|
this.changeState(-1, '');
|
||||||
|
Loading…
Reference in New Issue
Block a user