From a39d6d0ce464c0f06cd8995a21f7ae5e44bb2721 Mon Sep 17 00:00:00 2001 From: tylerapfledderer Date: Fri, 13 Sep 2024 13:39:09 -0400 Subject: [PATCH] refactor(vue/Field): expose v-model at form element --- packages/vue/CHANGELOG.md | 6 ++++++ .../vue/src/components/field/examples/input.vue | 4 +++- .../src/components/field/examples/select.vue | 4 +++- .../src/components/field/examples/textarea.vue | 4 +++- .../vue/src/components/field/field-input.vue | 17 ++++++++++++++--- .../vue/src/components/field/field-select.vue | 17 ++++++++++++++--- .../vue/src/components/field/field-textarea.vue | 16 +++++++++++++--- .../vue/src/components/field/field.stories.vue | 16 ++++++++++++++++ .../src/components/field/tests/field.test.tsx | 6 ++++++ .../src/components/field/tests/field.test.vue | 3 ++- 10 files changed, 80 insertions(+), 13 deletions(-) diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index 1ec40a5306..86c71dab00 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -6,6 +6,12 @@ description: All notable changes will be documented in this file. ## [Unreleased] +### Changed + +- **Field**: Expose `v-model` through `FieldInput`, `FieldSelect`, and `FieldTextarea`. Use + `v-model` at these components instead of `FieldRoot` to maintain value type for each form element, + as the type is variable. + ### Added - **Frame (Preview)**: Added `Frame` component for rendering components inside an iframe. diff --git a/packages/vue/src/components/field/examples/input.vue b/packages/vue/src/components/field/examples/input.vue index 6d26b1e6aa..a0a65603ab 100644 --- a/packages/vue/src/components/field/examples/input.vue +++ b/packages/vue/src/components/field/examples/input.vue @@ -1,11 +1,13 @@