splitProps
Edit this pageSplits a reactive object by keys.
It takes a reactive object and any number of arrays of keys; for each array of keys, it will return a reactive object with just those properties of the original object. The last reactive object in the returned array will have any leftover properties of the original object.
This can be useful if you want to consume a subset of props and pass the rest to a child.
Because splitProps
takes any number of arrays, we can split a props object as much as we wish (if, for example, we had multiple child components that each required a subset of the props).
Let's say a component was passed six props: