一、安装
npm install lodash --save
二、引入
// main.js
import lodash from 'lodash'
Vue.prototype.$lodash = lodash
三、使用
<script>
export default {
name: '',
mounted(){
this.formData = this.$lodash.cloneDeep(this.list)
},
}
</script>
lodash官网文档: