一、安装 cnpm i loash -S 或 npm i -g npm npm i --save lodash 二、引入 let _ = require('lodash') 三、使用 _.debounce(this.handleClick,1000,false) 四、实践 <template> <div>lodash.js</div> </template> <script> import _ from "lodash"; // _.chunk console.log(_.chunk(["a", "b", "c", "d"], 2)); // ["a","b"],["c","d"] console.log(_.chunk(["a", "b", "c", "d"], 3)); // ["a","b","c"],["d"] // _.compact // false, null, 0, "", undefined, and NaN 将会被“干掉” console.log(_.compact([0, 1, false, 2, "", 3, NaN, 4, null, 5, undefined])); // [1,2,3,4,5] // _.concat const array = 1; const other = _.concat(array, 2, [[3]], [4]); cons