merge: sync main branch

This commit is contained in:
IchliebedichZhu 2024-03-28 17:45:44 +00:00
commit 7da1a789ef
3 changed files with 9 additions and 7 deletions

View File

@ -67,7 +67,8 @@ function blurInput() {
} }
} }
function getValue(value: string) { function getValue(value: string) {
return value.replace(/\n|\r\n/g, '<br/>').replace(/ /g, '&nbsp;') return value
// return value.replace(/\n|\r\n/g, '<br/>').replace(/ /g, '&nbsp;')
} }
</script> </script>

View File

@ -164,8 +164,7 @@ function updateRecord() {
} }
function updateText(e?: Event) { function updateText(e?: Event) {
const value = e && e.target ? (e.target as HTMLElement).innerHTML : props.params.text.replace(/\n/g, '<br/>') const value = e && e.target ? (e.target as HTMLElement).innerHTML : props.params.text//.replace(/\n/g, '<br/>')
// const value = (e ? e.target.innerText : props.params.text).replace(/<br\/>/g, '\r\n').replace(/&nbsp;/g, ' ')
if (value !== props.params.text) { if (value !== props.params.text) {
store.dispatch('updateWidgetData', { store.dispatch('updateWidgetData', {
uuid: props.params.uuid, uuid: props.params.uuid,
@ -242,7 +241,7 @@ defineExpose({
.edit-text { .edit-text {
outline: none; outline: none;
word-break: break-word; word-break: break-word;
// white-space: pre; white-space: pre-wrap;
margin: 0; margin: 0;
} }
.effect-text { .effect-text {

View File

@ -79,13 +79,15 @@ function paste() {
*/ */
function undo(shiftKey: any) { function undo(shiftKey: any) {
const historyStore = useHistoryStore() const historyStore = useHistoryStore()
console.log(store.getters.dHistoryParams);
if (shiftKey) { if (shiftKey) {
if (!(historyStore.dHistoryParams.index === historyStore.dHistoryParams.length - 1)) { if (!(historyStore.dHistoryParams.index === historyStore.dHistoryParams.length - 1)) {
historyStore.handleHistory("redo") historyStore.handleHistory("redo")
// store.dispatch('handleHistory', 'redo') // store.dispatch('handleHistory', 'redo')
} }
} else if (!(historyStore.dHistoryParams.index === -1 || (historyStore.dHistoryParams.index === 0 && historyStore.dHistoryParams.length === 10))) { } else if (historyStore.dHistoryParams.index !== -1) {
historyStore.handleHistory("undo") // this.handleHistory('undo')
// store.dispatch('handleHistory', 'undo') store.dispatch('handleHistory', 'undo')
} }
} }