mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
fix: 空文本框检查错误(#169)
This commit is contained in:
parent
6cafd88270
commit
5ace85911b
@ -63,6 +63,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { debounce } from 'lodash'
|
||||
import { useMainStore, useSlidesStore } from '@/store'
|
||||
import { PPTTextElement } from '@/types/slides'
|
||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||
@ -174,10 +175,10 @@ const updateContent = (content: string) => {
|
||||
addHistorySnapshot()
|
||||
}
|
||||
|
||||
const checkEmptyText = () => {
|
||||
const checkEmptyText = debounce(function() {
|
||||
const pureText = props.elementInfo.content.replaceAll(/<[^>]+>/g, '')
|
||||
if (!pureText) slidesStore.deleteElement(props.elementInfo.id)
|
||||
}
|
||||
}, 300, { trailing: true })
|
||||
|
||||
const isHandleElement = computed(() => handleElementId.value === props.elementInfo.id)
|
||||
watch(isHandleElement, () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user