DEV Community

Discussion on: Pass all props to children in Vue

Collapse
jwkicklighter profile image
Jordan Kicklighter Author • Edited on

Sure enough, it does! I don't think I tried both v-bind="$props" andv-bind="$attrs"`, which is the trick. I'll update this post!

Collapse
nesterow profile image
Anton Nesterov

Thanks! Following also works:
v-bind="{...$props, ...$attrs}"

Thread Thread
jwkicklighter profile image
Jordan Kicklighter Author

That's a great space saver! Thanks 🙂