fix:任务审批添加销毁

pull/232/head
lihui_ocr 1 year ago
parent 9dd7ee140f
commit 8d4dcc04be

@ -5,6 +5,7 @@ import {
inject, inject,
onBeforeMount, onBeforeMount,
onMounted, onMounted,
onUnmounted,
ref, ref,
shallowRef, shallowRef,
unref, unref,
@ -142,6 +143,9 @@ onMounted(() => {
window.addEventListener('keydown', handleKeydown) window.addEventListener('keydown', handleKeydown)
init() init()
}) })
onUnmounted(()=>{
window.removeEventListener('keydown', handleKeydown)
})
async function init() { async function init() {
try { try {
const searchParam: FilterSearchParam = { const searchParam: FilterSearchParam = {

@ -484,6 +484,7 @@ function showActionsModal() {
onUnmounted(() => { onUnmounted(() => {
taskStore.reset() taskStore.reset()
window.removeEventListener('keydown', handleKeydown) window.removeEventListener('keydown', handleKeydown)
window.removeEventListener('scroll', checkBottom)
}) })
function immersionHandler() { function immersionHandler() {

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue' import { computed, nextTick, onMounted,onUnmounted, reactive, ref, watch } from 'vue'
import Masonry from 'masonry-layout' import Masonry from 'masonry-layout'
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from '@vueuse/core'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
@ -257,7 +257,9 @@ onMounted(() => {
show.value && addListeners() show.value && addListeners()
window.addEventListener('keydown', handleKeydown) window.addEventListener('keydown', handleKeydown)
}) })
onUnmounted(()=>{
window.removeEventListener('keydown', handleKeydown)
})
// //
function handleKeydown(event) { function handleKeydown(event) {
// //

Loading…
Cancel
Save