美文网首页
在Vue中使用lodash

在Vue中使用lodash

作者: 还在努力的乌贼 | 来源:发表于2020-05-20 10:33 被阅读0次

1.npm install lodash --save

2.全局引入
import _ from 'lodash'
Vue.prototype._ = _

使用
this._.debounce(this.handleClick,1000,false)

3.单个组件中引入
import isArray from "lodash/isArray";
isArray([]) //true

相关文章

网友评论

      本文标题:在Vue中使用lodash

      本文链接:https://www.haomeiwen.com/subject/emulohtx.html