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"
|
||||
:value="text.content"
|
||||
@update="value => updateText(value)"
|
||||
@blur="checkEmptyText()"
|
||||
@mousedown="$event => handleSelectElement($event, false)"
|
||||
/>
|
||||
</div>
|
||||
@ -163,6 +164,16 @@ export default defineComponent({
|
||||
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 {
|
||||
shadowStyle,
|
||||
outlineWidth,
|
||||
@ -173,6 +184,7 @@ export default defineComponent({
|
||||
text,
|
||||
handleSelectElement,
|
||||
updateText,
|
||||
checkEmptyText,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user