From e6b800ffa2534b4e4ba5f5c47d39f7097f097e34 Mon Sep 17 00:00:00 2001 From: joan xie Date: Fri, 15 May 2020 09:35:33 +0800 Subject: [PATCH 1/5] Create 0000-props-can-be-provided-with-setter.md --- .../0000-props-can-be-provided-with-setter.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 active-rfcs/0000-props-can-be-provided-with-setter.md diff --git a/active-rfcs/0000-props-can-be-provided-with-setter.md b/active-rfcs/0000-props-can-be-provided-with-setter.md new file mode 100644 index 00000000..322d3f1c --- /dev/null +++ b/active-rfcs/0000-props-can-be-provided-with-setter.md @@ -0,0 +1,104 @@ +- Start Date: 2020-5-15 +- Target Major Version: 2.x, 3.x +- Reference Issues: N/A +- Implementation PR: + +# Summary +- Make it simpler to pass `v-model` down in (say) wrapper components. + +# Basic Example +```html + + +``` + +# Motivation +It is often required that we rewrite existing form components that accept `v-model`s in wrapper components. However, we cannot simply pass the `v-model` down from the wrapper to the wrapped component: + +```html + + +``` + +# Drawbacks +It may make Vue’s one-way data flow less apparent. + +# Alternatives +https://github.com/vuejs/rfcs/pull/10: + +```html + + +``` From 132831ece944859010881ae46773c4bac7ca12e6 Mon Sep 17 00:00:00 2001 From: joan xie Date: Fri, 15 May 2020 09:45:21 +0800 Subject: [PATCH 2/5] Update 0000-props-can-be-provided-with-setter.md --- active-rfcs/0000-props-can-be-provided-with-setter.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/active-rfcs/0000-props-can-be-provided-with-setter.md b/active-rfcs/0000-props-can-be-provided-with-setter.md index 322d3f1c..7a6eb064 100644 --- a/active-rfcs/0000-props-can-be-provided-with-setter.md +++ b/active-rfcs/0000-props-can-be-provided-with-setter.md @@ -1,4 +1,4 @@ -- Start Date: 2020-5-15 +- Start Date: 2020-05-15 - Target Major Version: 2.x, 3.x - Reference Issues: N/A - Implementation PR: @@ -63,6 +63,9 @@ It is often required that we rewrite existing form components that accept `v-mod ``` +# Detailed design +An error can be thrown when trying to set a prop without setter. However when a prop has a setter (in the `set` property, as in `computed`), an attempt to set the prop will call the prop’s setter. + # Drawbacks It may make Vue’s one-way data flow less apparent. @@ -102,3 +105,7 @@ https://github.com/vuejs/rfcs/pull/10: }; ``` + +# Adoption Strategy + +https://github.com/vuejs/rfcs/pull/140 From d50c8bf110e3b6188b6eb8d41cf26e365a9ecfd9 Mon Sep 17 00:00:00 2001 From: joan xie Date: Fri, 15 May 2020 09:46:27 +0800 Subject: [PATCH 3/5] Update 0000-props-can-be-provided-with-setter.md --- active-rfcs/0000-props-can-be-provided-with-setter.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/active-rfcs/0000-props-can-be-provided-with-setter.md b/active-rfcs/0000-props-can-be-provided-with-setter.md index 7a6eb064..48269baf 100644 --- a/active-rfcs/0000-props-can-be-provided-with-setter.md +++ b/active-rfcs/0000-props-can-be-provided-with-setter.md @@ -106,6 +106,7 @@ https://github.com/vuejs/rfcs/pull/10: ``` -# Adoption Strategy - https://github.com/vuejs/rfcs/pull/140 + +# Adoption Strategy +N/A From c4935adbef2aedcb15687b3c71ab009740d14384 Mon Sep 17 00:00:00 2001 From: joan xie Date: Mon, 18 May 2020 11:57:00 +0800 Subject: [PATCH 4/5] Update 0000-props-can-be-provided-with-setter.md --- active-rfcs/0000-props-can-be-provided-with-setter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/active-rfcs/0000-props-can-be-provided-with-setter.md b/active-rfcs/0000-props-can-be-provided-with-setter.md index 48269baf..8e93b96b 100644 --- a/active-rfcs/0000-props-can-be-provided-with-setter.md +++ b/active-rfcs/0000-props-can-be-provided-with-setter.md @@ -64,7 +64,7 @@ It is often required that we rewrite existing form components that accept `v-mod ``` # Detailed design -An error can be thrown when trying to set a prop without setter. However when a prop has a setter (in the `set` property, as in `computed`), an attempt to set the prop will call the prop’s setter. +An error can be thrown when trying to set a prop without setter. However when a prop has a setter (in the `set` property, the same way as in `computed`), an attempt to set the prop will call the prop’s setter. # Drawbacks It may make Vue’s one-way data flow less apparent. From 4cdd953ad830a7d40f58ce34622eede48efec0fc Mon Sep 17 00:00:00 2001 From: joan xie Date: Mon, 18 May 2020 11:59:00 +0800 Subject: [PATCH 5/5] Update 0000-props-can-be-provided-with-setter.md --- active-rfcs/0000-props-can-be-provided-with-setter.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/active-rfcs/0000-props-can-be-provided-with-setter.md b/active-rfcs/0000-props-can-be-provided-with-setter.md index 8e93b96b..3282c8d6 100644 --- a/active-rfcs/0000-props-can-be-provided-with-setter.md +++ b/active-rfcs/0000-props-can-be-provided-with-setter.md @@ -19,7 +19,7 @@ model: { prop: 'value', event: 'input' - } + }, props: { label: String, value: { @@ -54,7 +54,7 @@ It is often required that we rewrite existing form components that accept `v-mod model: { prop: 'value', event: 'input' - } + }, props: { label: String, value: String @@ -84,7 +84,7 @@ https://github.com/vuejs/rfcs/pull/10: model: { prop: 'value', event: 'input' - } + }, props: { label: String, value: {