zoukankan      html  css  js  c++  java
  • vue中使用lodash的throttle不生效解决方案

     问题:

         如下使用不会执行代码,打印节流

    methods: {
        throttleHandler(){
    _.throttle(function () {
          console.log('节流');
          this.submit()
        }, buttonThrottle)
    },
    

     解决:

          需要改下如下写法

    methods: {
        throttleHandler: _.throttle(function () {
          console.log('截流');
          this.submit()
        }, buttonThrottle),
    

     如果觉得对你有帮助,欢迎打赏  

    热爱前端技术
  • 相关阅读:
    (一)Sturts2概述
    day18,常用的模块,os,sys...等
    day17,模块的导入
    day16
    day15
    day14
    day13
    day12
    day11
    day10
  • 原文地址:https://www.cnblogs.com/lcosima/p/14566334.html
Copyright © 2011-2022 走看看