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
443607170a
commit
2b18c36f84
@ -73,6 +73,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
import { computed, defineComponent, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'
|
||||||
import debounce from 'lodash/debounce'
|
import debounce from 'lodash/debounce'
|
||||||
|
import isEqual from 'lodash/isEqual'
|
||||||
import { useStore } from '@/store'
|
import { useStore } from '@/store'
|
||||||
import { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'
|
import { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'
|
||||||
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
import { ContextmenuItem } from '@/components/Contextmenu/types'
|
||||||
@ -196,7 +197,8 @@ export default defineComponent({
|
|||||||
return selectedCells
|
return selectedCells
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(selectedCells, () => {
|
watch(selectedCells, (value, oldValue) => {
|
||||||
|
if (isEqual(value, oldValue)) return
|
||||||
emit('changeSelectedCells', selectedCells.value)
|
emit('changeSelectedCells', selectedCells.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user