diff --git a/active-rfcs/0010-optional-props-declaration.md b/active-rfcs/0010-optional-props-declaration.md new file mode 100644 index 00000000..e0c53936 --- /dev/null +++ b/active-rfcs/0010-optional-props-declaration.md @@ -0,0 +1,92 @@ +- Start Date: 2019-04-08 +- Target Major Version: 2.x & 3.x +- Reference Issues: N/A +- Implementation PR: N/A + +# Summary + +Make component `props` declaration optional. + +# Basic example + +``` html + + + +``` + +# Motivation + +In simple use cases where there is no need for runtime props type checking (especially in functional components), making props optional could result in simpler code. + +# Detailed design + +## Stateful Components + +When a component has no `props` declarations, all attributes passed by the parent are exposed in `this.$props`. Unlike declared props, they will NOT be exposed directly on `this`. In addition, in this case `this.$attrs` and `this.$props` will be pointing to the same object. + +``` html + + + +``` + +If the component has no other options, the entire `