Skip to content

Warn about this. used in templates #11715

Open
@tstriker

Description

@tstriker

What problem does this feature solve?

Sometimes when moving the code around, the this. can end up traveling with it. Or the finger memory will just type in the this. where none is required.

Due to a side-effect, the this context is indeed present, but it breaks when it's used deeper in templates (haven't looked exactly, but i think it breaks in v-if's or somewhere around there.

To avoid inadvertent breakages, it would be nice if vue could warn about it.

What does the proposed API look like?

a this. spotted in javascript bits of template would show a warning in the javascript console

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions