feat: 新增题目优化

This commit is contained in:
梁亚鑫 2024-10-13 12:12:06 +08:00
parent d4bdedb325
commit 45bf28b612
2 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,7 @@
:list="item.questionList"
:group="{ name: DND_GROUP, pull: 'clone', put: false }"
:clone="createNewQuestion"
@end="onDragEnd"
item-key="path"
>
<template #item="{ element }">
@ -70,6 +71,10 @@ const onQuestionType = ({ type }) => {
setCurrentEditOne(newQuestionIndex.value)
}
const onDragEnd = (event) => {
setCurrentEditOne(event.newIndex)
}
const showPreview = ({ snapshot }, id) => {
previewImg.value = snapshot

View File

@ -166,7 +166,7 @@ export const useEditStore = defineStore('edit', () => {
if (!questCount) {
return startIndex
}
return endIndex
return endIndex - 1
}
})