Skip to content

[FR] Support console in the template #7939

@wenfangdu

Description

@wenfangdu

What problem does this feature solve?

I don't understand, why console can't be used in the template since Vue 2, it makes template debugging much more complicated than it needs to be, Svelte supports console in the template out of the box, can Vue be more user friendly in this regard?

What does the proposed API look like?

<template> <!-- just works, no more `console` doesn't exist --> <button @click="console.log">Log</button> </template>

If we want to discourage console usage in the templates, it can be achieved using eslint lint rules, but not usable at all is a complete overkill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions