pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/max-props |
enforce maximum number of props in Vue component |
enforce maximum number of props in Vue component
- ❗ This rule has not been released yet.
This rule enforces a maximum number of props in a Vue SFC, in order to aid in maintainability and reduce complexity.
This rule takes an object, where you can specify the maximum number of props allowed in a Vue SFC. There is one property that can be specified for the object.
maxProps
... Specify the maximum number of props in thescript
block.
<!-- ✗ BAD -->
<template>
</template>
<script setup>
defineProps({
prop1: String,
prop2: String,
})
</script>
<!-- ✓ GOOD -->
<script>
defineProps({
prop1: String
})
</script>