How to bind console.log to "l" in vue.js?

Viewed 3014

main.js has this code

window.l = function () { }
try {
  window.l = console.log.bind(console)
} catch (e) { }

which works in non-Vue apps. However, when calling

l("test")

from a Vue action/method, it complains it isn't defined.

How can that work?

Reasoning: need to output some debugging data, with as less typing as possible.

2 Answers
Related