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