diff --git a/packages/canvas/DesignCanvas/src/api/useCanvas.js b/packages/canvas/DesignCanvas/src/api/useCanvas.js index dfe347fd8..34308096f 100644 --- a/packages/canvas/DesignCanvas/src/api/useCanvas.js +++ b/packages/canvas/DesignCanvas/src/api/useCanvas.js @@ -560,6 +560,7 @@ export default function () { setSaved, clearCanvas, getPageSchema, + resetCanvasState, resetPageCanvasState, resetBlockCanvasState, clearCurrentState, diff --git a/packages/toolbars/redoundo/src/composable/useHistory.js b/packages/toolbars/redoundo/src/composable/useHistory.js index 0ac76af49..52860d20d 100644 --- a/packages/toolbars/redoundo/src/composable/useHistory.js +++ b/packages/toolbars/redoundo/src/composable/useHistory.js @@ -61,7 +61,8 @@ const push = (schema) => { const go = (addend, valid) => { historyState.index = historyState.index + addend - useCanvas().importSchema(string2Schema(list[historyState.index])) + const { pageState, resetCanvasState } = useCanvas() + resetCanvasState({ ...pageState, pageSchema: string2Schema(list[historyState.index]) }) // 不是锁定状态,撤销操作后,传递第二个标识位,将 list 的长度减一,置灰 undoredo 操作按钮 if (typeof valid === 'boolean') {