Merge pull request #104 from JeremyYu-cn/feat-upgrade-vue3

Merge: main branch
This commit is contained in:
Jeremy Yu 2024-03-28 17:47:25 +00:00 committed by GitHub
commit b3a70d270a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View File

@ -67,7 +67,8 @@ function blurInput() {
}
}
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>

View File

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

View File

@ -77,12 +77,14 @@ function paste() {
*
*/
function undo(shiftKey: any) {
console.log(store.getters.dHistoryParams);
if (shiftKey) {
if (!(store.getters.dHistoryParams.index === store.getters.dHistoryParams.length - 1)) {
// this.handleHistory('redo')
store.dispatch('handleHistory', 'redo')
}
} else if (!(store.getters.dHistoryParams.index === -1 || (store.getters.dHistoryParams === 0 && store.getters.dHistoryParams.length === 10))) {
} else if (store.getters.dHistoryParams.index !== -1) {
// this.handleHistory('undo')
store.dispatch('handleHistory', 'undo')
}