撤销重做

This commit is contained in:
yyy 2025-02-07 09:24:39 +08:00
parent 17f9c226d1
commit b08d79abe8

View File

@ -152,7 +152,7 @@ const addEditHistory = () => {
// currentIndex
if (currentIndex.value !== allHistoryList.value.length - 1) {
allHistoryList.value = allHistoryList.value.splice(0, currentIndex.value)
currentIndex.value++
currentIndex.value = allHistoryList.value.length
allHistoryList.value.push(JSON.parse(JSON.stringify(imgList.value)))
} else {
currentIndex.value++
@ -165,6 +165,7 @@ const addEditHistory = () => {
const backPreviousStep = () => {
if (currentIndex.value > 0) {
currentIndex.value--
imgList.value = allHistoryList.value[currentIndex.value]
console.log('撤销', allHistoryList.value[currentIndex.value])
} else {
message.warning('没了老铁')
@ -174,6 +175,7 @@ const backPreviousStep = () => {
const backNextStep = () => {
if (currentIndex.value < allHistoryList.value.length - 1) {
currentIndex.value++
imgList.value = allHistoryList.value[currentIndex.value]
console.log('重做', allHistoryList.value[currentIndex.value])
} else {
message.warning('没了老铁')