SoFunction
Updated on 2025-04-04

Debounce attribute of vue is removed and detailed explanation of the processing

vue 2.0 debounce has been removed

Reference documentation:

/v2/guide/#Replace -debounce-filter

/v2/guide/#debounce-Param-Attribute-for-v-model-removed

Complete code:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>vue-Repeat cycle</title>
  <script src="/[email protected]/dist/"></script>
  <script src="/[email protected]/"></script>
</head>
<body>
<div >
  <input type="button" @click="add" value="Add to">
  <ul>
    <li v-for="val in arr">
      [[val]]
    </li>
  </ul>
</div>
<script>
  var vm = new Vue({
    delimiters: ['[[', ']]'],
    el: '#box',
    data: {
      arr: ['apple', 'pear', 'grape']
    },
    methods: {
      add: _.debounce(function () {
        ('tomato')
      }, 1000)
    }

  })
</script>
</body>
</html>

When using the official '_.debounce(), import:

<script src="/[email protected]/"></script>

The above detailed explanation of the debounce attribute of vue and its processing is all the content I share with you. I hope you can give you a reference and I hope you can support me more.