mirror of https://github.com/vuejs/vue.git
clean computed fields in $log.
This commit is contained in:
parent
d8d55858be
commit
5d0624b00c
|
|
@ -134,13 +134,25 @@ exports.$log = function (path) {
|
|||
? Path.get(this._data, path)
|
||||
: this._data
|
||||
if (data) {
|
||||
data = JSON.parse(JSON.stringify(data))
|
||||
data = clean(data)
|
||||
}
|
||||
// include computed fields
|
||||
if (!path) {
|
||||
for (var key in this.$options.computed) {
|
||||
data[key] = this[key]
|
||||
data[key] = clean(this[key])
|
||||
}
|
||||
}
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* "clean" a getter/setter converted object into a plain
|
||||
* object copy.
|
||||
*
|
||||
* @param {Object} - obj
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
function clean (obj) {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue