mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
perf: 形状内文字编辑优化
This commit is contained in:
parent
5eeb1fb545
commit
6a7e172140
@ -68,6 +68,7 @@
|
|||||||
:autoFocus="true"
|
:autoFocus="true"
|
||||||
:value="text.content"
|
:value="text.content"
|
||||||
@update="value => updateText(value)"
|
@update="value => updateText(value)"
|
||||||
|
@blur="checkEmptyText()"
|
||||||
@mousedown="$event => handleSelectElement($event, false)"
|
@mousedown="$event => handleSelectElement($event, false)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -163,6 +164,16 @@ export default defineComponent({
|
|||||||
addHistorySnapshot()
|
addHistorySnapshot()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkEmptyText = () => {
|
||||||
|
if (!props.elementInfo.text) return
|
||||||
|
|
||||||
|
const pureText = props.elementInfo.text.content.replaceAll(/<[^>]+>/g, '')
|
||||||
|
if (!pureText) {
|
||||||
|
slidesStore.removeElementProps({ id: props.elementInfo.id, propName: 'text' })
|
||||||
|
addHistorySnapshot()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shadowStyle,
|
shadowStyle,
|
||||||
outlineWidth,
|
outlineWidth,
|
||||||
@ -173,6 +184,7 @@ export default defineComponent({
|
|||||||
text,
|
text,
|
||||||
handleSelectElement,
|
handleSelectElement,
|
||||||
updateText,
|
updateText,
|
||||||
|
checkEmptyText,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user