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