JS.VUE.NO.DEPRECATED.SCOPE.ATTRIBUTE

Disallow deprecated 'scope' attribute (in Vue.js 2.5.0+)

Rule Details

This rule reports deprecated scope attribute in Vue.js v2.5.0+.

{'vue/no-deprecated-scope-attribute': ['error']}

Copy
<template>
  <ListComponent>
    <!-- GOOD -->
    <template v-slot:name="props">
      {{ props.title }}
    </template>
    <template slot="name" slot-scope="props">
      {{ props.title }}
    </template>
  </ListComponent>
  <ListComponent>
    <!-- BAD -->
    <template slot="name" scope="props">
      {{ props.title }}
    </template>
  </ListComponent>
</template>

Further Reading

  • API - scope (https://v2.vuejs.org/v2/api/#scope-removed)

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/