omip - delete obj key when value is undefined
This commit is contained in:
parent
d94c0b989d
commit
2783ad7284
|
@ -19,6 +19,12 @@ class Component {
|
|||
console.log(e)
|
||||
}
|
||||
|
||||
for (let key in this.data) {
|
||||
if (this.data[key] === undefined) {
|
||||
delete this.data[key]
|
||||
}
|
||||
}
|
||||
|
||||
if (arguments.length === 0) {
|
||||
this.$scope.setData(this.data)
|
||||
} else if (arguments.length === 1) {
|
||||
|
|
|
@ -19,6 +19,12 @@ class Component {
|
|||
console.log(e)
|
||||
}
|
||||
|
||||
for (let key in this.data) {
|
||||
if (this.data[key] === undefined) {
|
||||
delete this.data[key]
|
||||
}
|
||||
}
|
||||
|
||||
if (arguments.length === 0) {
|
||||
this.$scope.setData(this.data)
|
||||
} else if (arguments.length === 1) {
|
||||
|
|
|
@ -19,6 +19,12 @@ class Component {
|
|||
console.log(e)
|
||||
}
|
||||
|
||||
for (let key in this.data) {
|
||||
if (this.data[key] === undefined) {
|
||||
delete this.data[key]
|
||||
}
|
||||
}
|
||||
|
||||
if (arguments.length === 0) {
|
||||
this.$scope.setData(this.data)
|
||||
} else if (arguments.length === 1) {
|
||||
|
|
Loading…
Reference in New Issue