Skip to content

Commit 8899672

Browse files
committed
fix vm.$log when property is not observed or does not exist
1 parent cfade3f commit 8899672

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/data.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ exports.$interpolate = function (text) {
152152

153153
exports.$log = function (path) {
154154
var data = path
155-
? Path.get(this, path)
155+
? Path.get(this._data, path)
156156
: this._data
157-
console.log(JSON.parse(JSON.stringify(data)))
157+
if (data) {
158+
data = JSON.parse(JSON.stringify(data))
159+
}
160+
console.log(data)
158161
}

0 commit comments

Comments
 (0)