d0cdc4c4 by 刘远

s

1 parent 8a00988d
......@@ -51,30 +51,4 @@ export default {
}
return newArr;
},
/**
* @brief:深度拷贝
* @param {*} data => obj
* */
deepClone: function (data) {
var type = this.getType(data);
var obj;
if (type === 'array') {
obj = [];
} else if (type === 'object') {
obj = {};
} else {
//不再具有下一层次
return data;
}
if (type === 'array') {
for (var i = 0, len = data.length; i < len; i++) {
obj.push(this.deepClone(data[i]));
}
} else if (type === 'object') {
for (var key in data) {
obj[key] = this.deepClone(data[key]);
}
}
return obj;
},
}
\ No newline at end of file
......
......@@ -13,6 +13,9 @@
return {
}
},
mounted() {
// let aa = this.commons.dateZhuan('yyyy-MM-dd', new Date());
}
}
</script>
\ No newline at end of file
......