Contributions to docs are always welcome . For more information, see our Privacy Statement. For example, given a post object: All props form a one-way-down binding between the child property and the parent one: when the parent property updates, it will flow down to the child, but not the other way around. A validator is simply a function that takes the input property value and returns a boolean, true if it is valid, false otherwise. You can force a property to be required by adding the required: true value to the property definition. By saying the prop is required you expect the user to always provide a value, so making it have a default value defeats the purpose of the prop being required. name: 'Veronica', As long as the tests all still pass after the refactor, we can be sure we did not break anything. Yeah, currently the issue that is required: true implies that the prop cannot be absent, but then if required: false and the prop value is nully then validation is skipped altogether. There are usually two cases where it's tempting to mutate a prop: Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component will affect parent state. data, computed, etc) will not be available inside default or validator functions. :D. Sign up for Infrastructure as a Newsletter. By clicking “Sign up for GitHub”, you agree to our terms of service and Learn more, Vue warns about missing required prop that has a default value. Working on improving health and education, reducing inequality, and spurring economic growth? Hub for Good For v3.x, click here. data, computed, etc) will not be available inside default or validator functions. There is no way to enforce a prop to be non-nully at all times without required: true and hence prop omission is disallowed. Everything is still passing. TLDR; Maybe we should indeed allow required + default value in this check. -->, , , , ,