Skip to content

Is there a way to prevent unnecessary props from being passed when using v-bind="$props"? #12888

Discussion options

You must be logged in to vote

You listed the two methods that are available, basically. For the destructuring way, I would often rather use a helper function like lodash's omit or pick.

You could then turn that into a more descriptive Helper:

const toListItemProps (props) => pick(props, ['label', 'actions'])
```

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@undefinedspacex
Comment options

@undefinedspacex
Comment options

Answer selected by undefinedspacex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants