撤销重做
This commit is contained in:
parent
17f9c226d1
commit
b08d79abe8
@ -152,7 +152,7 @@ const addEditHistory = () => {
|
|||||||
//要判断是不是在最新的记录上修改 如果不是 要把currentIndex之后的记录都删掉 保持当前修改是最新的
|
//要判断是不是在最新的记录上修改 如果不是 要把currentIndex之后的记录都删掉 保持当前修改是最新的
|
||||||
if (currentIndex.value !== allHistoryList.value.length - 1) {
|
if (currentIndex.value !== allHistoryList.value.length - 1) {
|
||||||
allHistoryList.value = allHistoryList.value.splice(0, currentIndex.value)
|
allHistoryList.value = allHistoryList.value.splice(0, currentIndex.value)
|
||||||
currentIndex.value++
|
currentIndex.value = allHistoryList.value.length
|
||||||
allHistoryList.value.push(JSON.parse(JSON.stringify(imgList.value)))
|
allHistoryList.value.push(JSON.parse(JSON.stringify(imgList.value)))
|
||||||
} else {
|
} else {
|
||||||
currentIndex.value++
|
currentIndex.value++
|
||||||
@ -165,6 +165,7 @@ const addEditHistory = () => {
|
|||||||
const backPreviousStep = () => {
|
const backPreviousStep = () => {
|
||||||
if (currentIndex.value > 0) {
|
if (currentIndex.value > 0) {
|
||||||
currentIndex.value--
|
currentIndex.value--
|
||||||
|
imgList.value = allHistoryList.value[currentIndex.value]
|
||||||
console.log('撤销', allHistoryList.value[currentIndex.value])
|
console.log('撤销', allHistoryList.value[currentIndex.value])
|
||||||
} else {
|
} else {
|
||||||
message.warning('没了老铁')
|
message.warning('没了老铁')
|
||||||
@ -174,6 +175,7 @@ const backPreviousStep = () => {
|
|||||||
const backNextStep = () => {
|
const backNextStep = () => {
|
||||||
if (currentIndex.value < allHistoryList.value.length - 1) {
|
if (currentIndex.value < allHistoryList.value.length - 1) {
|
||||||
currentIndex.value++
|
currentIndex.value++
|
||||||
|
imgList.value = allHistoryList.value[currentIndex.value]
|
||||||
console.log('重做', allHistoryList.value[currentIndex.value])
|
console.log('重做', allHistoryList.value[currentIndex.value])
|
||||||
} else {
|
} else {
|
||||||
message.warning('没了老铁')
|
message.warning('没了老铁')
|
||||||
|
Loading…
Reference in New Issue
Block a user