feat: 多选状态下移动鼠标不再激活列表条目

This commit is contained in:
ZiuChen 2022-09-25 14:47:14 +08:00
parent 905e2f9ff2
commit 465755ee5f

View File

@ -120,6 +120,7 @@ const handleItemClick = (ev, item) => {
if (props.isMultiple === true) {
const i = selectItemList.value.indexOf(item) //
const index = props.showList.indexOf(item) //
activeIndex.value = index
if (selectItemList.value.length !== 0 && isShiftDown.value) {
// Shift
// selectList
@ -185,7 +186,11 @@ const handleItemClick = (ev, item) => {
}
}
const activeIndex = ref(0)
const handleMouseOver = (index) => (activeIndex.value = index)
const handleMouseOver = (index) => {
if (!props.isMultiple) {
activeIndex.value = index
}
}
// getter
watch(
() => props.showList,