mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
fix: Text-editing undo bug
This commit is contained in:
parent
af9e7292b0
commit
65453b5a3a
@ -3,7 +3,7 @@
|
|||||||
* @Date: 2022-03-09 16:29:54
|
* @Date: 2022-03-09 16:29:54
|
||||||
* @Description: 处理和ctrl建相关的操作
|
* @Description: 处理和ctrl建相关的操作
|
||||||
* @LastEditors: ShawnPhang <https://m.palxp.cn>
|
* @LastEditors: ShawnPhang <https://m.palxp.cn>
|
||||||
* @LastEditTime: 2024-04-18 17:35:57
|
* @LastEditTime: 2025-02-12 18:52:35
|
||||||
*/
|
*/
|
||||||
// import store from '@/store'
|
// import store from '@/store'
|
||||||
import handlePaste from './handlePaste'
|
import handlePaste from './handlePaste'
|
||||||
@ -84,15 +84,12 @@ function paste() {
|
|||||||
* 撤销
|
* 撤销
|
||||||
*/
|
*/
|
||||||
function undo(shiftKey: any) {
|
function undo(shiftKey: any) {
|
||||||
|
const widgetStore = useWidgetStore()
|
||||||
const historyStore = useHistoryStore()
|
const historyStore = useHistoryStore()
|
||||||
shiftKey ? historyStore.handleHistory("redo") : historyStore.handleHistory('undo')
|
|
||||||
|
const { type, editable }: any = widgetStore.dActiveElement
|
||||||
// if (shiftKey) {
|
if (type === 'w-text') {
|
||||||
// if (!(historyStore.dHistoryParams.index === historyStore.dHistoryParams.length - 1)) {
|
// 不在编辑状态则执行撤销操作
|
||||||
// historyStore.handleHistory("redo")
|
!editable && (shiftKey ? historyStore.handleHistory('redo') : historyStore.handleHistory('undo'))
|
||||||
// }
|
} else shiftKey ? historyStore.handleHistory('redo') : historyStore.handleHistory('undo')
|
||||||
// } else if (historyStore.dHistoryParams.index !== -1) {
|
|
||||||
// // this.handleHistory('undo')
|
|
||||||
// historyStore.handleHistory('undo')
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user