Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
刘远
/
3d_dc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
d0cdc4c4
authored
2020-07-23 10:54:56 +0800
by
刘远
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
s
1 parent
8a00988d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
26 deletions
src/commons/commons.js
src/views/Home.vue
src/commons/commons.js
View file @
d0cdc4c
...
...
@@ -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
...
...
src/views/Home.vue
View file @
d0cdc4c
...
...
@@ -13,6 +13,9 @@
return
{
}
},
mounted
()
{
// let aa = this.commons.dateZhuan('yyyy-MM-dd', new Date());
}
}
</
script
>
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment