Explorar el Código

fix vm.$log when property is not observed or does not exist

Evan You hace 11 años
padre
commit
88996727f5
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      src/api/data.js

+ 5 - 2
src/api/data.js

@@ -152,7 +152,10 @@ exports.$interpolate = function (text) {
 
 exports.$log = function (path) {
   var data = path
-    ? Path.get(this, path)
+    ? Path.get(this._data, path)
     : this._data
-  console.log(JSON.parse(JSON.stringify(data)))
+  if (data) {
+    data = JSON.parse(JSON.stringify(data))
+  }
+  console.log(data)
 }