JS.VUE.NO.MULTIPLE.SLOT.ARGS

Disallow to pass multiple arguments to scoped slots

Rule Details

This rule disallows to pass multiple arguments to scoped slots.
In details, it reports call expressions if a call of this.$scopedSlots members has 2 or more arguments.

{'vue/no-multiple-slot-args': ['error']}

Copy
<script>
export default {
  render(h) {
    /* GOOD */
    var children = this.$scopedSlots.default()
    var children = this.$scopedSlots.default(foo)
    var children = this.$scopedSlots.default({ foo, bar })

    /* BAD */
    var children = this.$scopedSlots.default(foo, bar)
    var children = this.$scopedSlots.default(...foo)
  }
}
</script>

Options

Nothing.

Further Reading

  • vuejs/vue#9468 (https://github.com/vuejs/vue/issues/9468#issuecomment-462210146)

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/