From 6f65ed210c7056372072ed3ecec6a224e6c718d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Wed, 19 Jun 2019 23:09:17 +0200 Subject: [PATCH] fix(d-form-textarea): add the 'value' prop Passing a 'value' prop to the FormTextarea didn't do anything for two reasons: * the 'value' prop wasn't declared, so it was always undefined * the 'localValue' prop wasn't passed to the underlying textarea component, so the textarea wasn't controlled (it did not show the current value). Using a v-model on the textarea simplifies the code a bit by sending and updating localValue at the same time. --- src/components/form-textarea/FormTextarea.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/form-textarea/FormTextarea.vue b/src/components/form-textarea/FormTextarea.vue index 8c0c2cd..42f6778 100644 --- a/src/components/form-textarea/FormTextarea.vue +++ b/src/components/form-textarea/FormTextarea.vue @@ -1,6 +1,7 @@ @@ -34,6 +34,13 @@ export default { }; }, props: { + /** + * The element value. + */ + value: { + type: String, + default: '' + }, /** * The element name. */ @@ -241,10 +248,5 @@ export default { } } }, - methods: { - handleInput(e) { - this.localValue = e.target.value; - } - } };