Answer the question
In order to leave comments, you need to log in
How to create a copy of an object from data in vuejs?
The question arose of creating a copy of the object / array from the data of the vue instance. When I do something like this:
let filterDate = {};
filterDate = this.filters.dates;
Answer the question
In order to leave comments, you need to log in
const copyObject = JSON.parse(JSON.stringify(object))
const copyObject = Object.assign({}, object);
https://lodash.com/docs/4.17.4#clone
https://lodash.com/docs/4.17.4#cloneDeep
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question