[Vuejs]-Vue JS console log without define a method

-1👍

in your template use two curly braces like this
{{console.log(‘hello’)}}

-1👍

It is very simple, but not very recommended.
To issue a console.log directly in the template you can use:

this.console.log('test')

For example:

<button @click="this.console.log('Hello')"> My Button </button>

I hope I helped in some way

Leave a comment