uu
This commit is contained in:
parent
6168e1c43e
commit
4ca72eabcd
@ -122,9 +122,9 @@ const debounce = (fn, wait) => {
|
||||
let callNow = !timer
|
||||
timer = setTimeout(() => {
|
||||
console.log('发送')
|
||||
fn.apply(this, args)
|
||||
timer = null
|
||||
}, delay)
|
||||
if (callNow) fn.apply(this, args)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -15,16 +15,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { throttle } from "@/common/util"
|
||||
import { debounce } from "@/common/util"
|
||||
|
||||
export default {
|
||||
watch: {
|
||||
searchParam: {
|
||||
handler(cval, oval) {
|
||||
throttle(()=> {
|
||||
this.getDataList(true)
|
||||
}, 500)
|
||||
},
|
||||
handler: debounce(function(cval, oval) {
|
||||
console.log("========qqqqqqqqqq")
|
||||
this.getDataList(true)
|
||||
}),
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user