Logging Values in SFC Template

Learn how to debug values in the Vue template by using a new component.

From time to time, we might want to check what values are in a template. However, there’s no access to the console.log method directly in the Vue template, and if we try to use it, we’ll get an error. We can create a new method on the Vue component just to log out values, but it’s very tedious to do it every time we want to see what kind of value a variable in the template contains. Instead, we can use an automatically registered component, as shown below.

Get hands-on with 1200+ tech skills courses.