fix: 搜索词更新列表后 未自动激活首条历史纪录

This commit is contained in:
ZiuChen
2022-09-16 10:00:42 +08:00
parent f02c74ead1
commit 571e5606f9

View File

@@ -237,7 +237,10 @@ const handleOperateClick = ({ id, item }) => {
}
}
// 父组件中改变了引用类型的地址 故要用 getter返回
watch(props.showList, () => (activeIndex.value = 0))
watch(
() => props.showList,
() => (activeIndex.value = 0)
)
onMounted(() => {
// 监听键盘事件
document.addEventListener('keydown', (e) => {