From 5e89a14b63436ae0fc26913966fa53c2b6df12d5 Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Thu, 1 Dec 2022 12:26:44 -0500 Subject: [PATCH 1/2] Fix Invalid prop warning for modelValue in base-input-button component --- .../base-input-button/button-functionality-props.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common-components/base-input-button/button-functionality-props.js b/src/common-components/base-input-button/button-functionality-props.js index 1faa369e..ec83f95f 100644 --- a/src/common-components/base-input-button/button-functionality-props.js +++ b/src/common-components/base-input-button/button-functionality-props.js @@ -3,9 +3,16 @@ export const inputButtonProps = { type: [String, Number], required: true, }, - modelValue: { - type: [Array, String, Number], + modelValue: { required: true, + validation: function(prop) { + return ( + prop === null + || Array.isArray(prop) + || typeof prop === 'string' + || (typeof prop === 'number' && !Number.isNaN(prop)) + ) + } }, isMultiSelect: Boolean, groupName: { From 8281a7faf912e152f6a61c1c2ccf0a5f53991861 Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Thu, 1 Dec 2022 15:12:09 -0500 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20=E2=80=9CInvalid=20prop:=20type=20che?= =?UTF-8?q?ck=20failed=20for=20prop=20"answers"=20warnings=20displayed=20i?= =?UTF-8?q?n=20the=20DevTools=20Console=20when=20opening=20the=20=E2=80=9C?= =?UTF-8?q?vehicle-year=E2=80=9D=20page=20locally.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial value for "years" should be assigned to an empty array. "Array" is a function and need to be called with "new Array()" to get an empty array. I opted for a shorter syntax but the idea is the same. --- src/layouts/vehicle-year/year-question/year-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/vehicle-year/year-question/year-question.vue b/src/layouts/vehicle-year/year-question/year-question.vue index 0cd35425..84dfd15f 100644 --- a/src/layouts/vehicle-year/year-question/year-question.vue +++ b/src/layouts/vehicle-year/year-question/year-question.vue @@ -20,7 +20,7 @@ name: "year-question", data() { return { - years: Array, + years: [], }; }, props: {