Skip to content

vue/this-in-template

disallow usage of this in template

  • ⚙️ This rule is included in all of "plugin:vue/vue3-recommended", *.configs["flat/recommended"], "plugin:vue/recommended" and *.configs["flat/vue2-recommended"].
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule aims at preventing usage of this in Vue templates.

Now loading...

🔧 Options

json
{
  "vue/this-in-template": ["error", "always" | "never"]
}
  • "always" ... Always use this while accessing properties from Vue.
  • "never" (default) ... Never use this keyword in expressions.

"always"

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v3.13.0

🔍 Implementation