【问题标题】:Vue: ESlint rule to remove "this" from templateVue:从模板中删除“this”的 ESlint 规则
【发布时间】:2021-10-17 14:46:49
【问题描述】:

我正在尝试查看是否存在一个现有的 ESlint 规则,该规则将删除在道具或数据之前使用的this

例子:

<template>
  <div v-if="this.foo"></div>
</template>

理想情况下,这将被 linter 捕获,因为 this.foo 而不仅仅是 foo。是否存在这样的规则?前几天我尝试搜索,但没有找到。

【问题讨论】:

    标签: javascript vue.js vuejs2 eslint


    【解决方案1】:

    this(没有双关语)是您正在寻找的。虽然它不会明确地“删除”它,但我相信它会引发错误供您查看。

    【讨论】:

      猜你喜欢
      • 2021-07-13
      • 2022-09-26
      • 2020-11-10
      • 2020-01-25
      • 2020-10-07
      • 1970-01-01
      • 2021-08-31
      • 1970-01-01
      • 2019-02-10
      相关资源
      最近更新 更多