Parcourir la source

在组件中已使用debounce防抖

lifanagju_citu il y a 11 mois
Parent
commit
f7569b2c34
1 fichiers modifiés avec 5 ajouts et 5 suppressions
  1. 5 5
      src/views/resume/components/workExperience.vue

+ 5 - 5
src/views/resume/components/workExperience.vue

@@ -54,7 +54,7 @@ import { getTimeStamp, timesTampChange } from '@/utils/date'
 import { saveResumeWorkExp, getResumeWorkExp, deleteResumeWorkExp, enterpriseSearchByName } from '@/api/resume'
 import Confirm from '@/plugins/confirm'
 import { dealCanBeInputtedSave, dealCanBeInputtedValueAndLabel } from '@/utils/getText'
-import { debounce } from 'lodash'
+// import { debounce } from 'lodash'
 import { nextTick, reactive, ref } from 'vue'
 const editId = ref(null)
 const CtFormRef = ref()
@@ -70,9 +70,9 @@ const getSchoolListData = async (name, init = '') => {
   const data = await enterpriseSearchByName({ name })
   item.items = data
 }
-const debouncedCallbackSchool = debounce(newValue => {
-  getSchoolListData(newValue)
-}, 500)
+// const debouncedCallbackSchool = debounce(newValue => {
+//   getSchoolListData(newValue)
+// }, 500)
 
 const positionSearch = (name, init = '') => {
   const item = formItems.value.options.find(e => e.key === 'positionId')
@@ -97,7 +97,7 @@ const formItems = ref({
       itemText: 'value',
       itemValue: 'key',
       rules: [v => !!v || '请选择企业名称'],
-      search: debouncedCallbackSchool,
+      search: getSchoolListData,
       items: []
     },
     {