提交 9a8c0d13 authored 作者: wangjiahao's avatar wangjiahao

fix: 重做是 刷新CurComponent

上级 4ecb2830
<!-- TODO: 这个页面后续将用 JSX 重构 --> <!-- TODO: 这个页面后续将用 JSX 重构 -->
<template> <template>
<div class="attr-list"> <div class="attr-list">
<el-form label-width="80px"> <el-form label-width="80px" size="mini">
<el-form-item v-for="(key, index) in styleKeys.filter(item => item != 'rotate')" :key="index" :label="map[key]+':'"> <el-form-item v-for="(key, index) in styleKeys.filter(item => item != 'rotate')" :key="index" :label="map[key]+':'">
<el-color-picker v-if="key == 'borderColor'" v-model="curComponent.style[key]" /> <el-color-picker v-if="key == 'borderColor'" v-model="curComponent.style[key]" />
<el-color-picker v-else-if="key == 'color'" v-model="curComponent.style[key]" /> <el-color-picker v-else-if="key == 'color'" v-model="curComponent.style[key]" />
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
}, },
mutations: { mutations: {
undo(state) { undo(state) {
store.commit('setCurComponent', { component: null, index: null })
if (state.snapshotIndex > 0) { if (state.snapshotIndex > 0) {
state.snapshotIndex-- state.snapshotIndex--
store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex])) store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex]))
...@@ -17,6 +18,7 @@ export default { ...@@ -17,6 +18,7 @@ export default {
}, },
redo(state) { redo(state) {
store.commit('setCurComponent', { component: null, index: null })
if (state.snapshotIndex < state.snapshotData.length - 1) { if (state.snapshotIndex < state.snapshotData.length - 1) {
state.snapshotIndex++ state.snapshotIndex++
store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex])) store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex]))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论