From 016f51175fa72945bdbe8f8da311f9e42770eb99 Mon Sep 17 00:00:00 2001 From: antoine Date: Thu, 3 Dec 2020 19:27:47 +0100 Subject: [PATCH] Handle conditionalDisplays --- packages/formoj/example/data/form.json | 6 ++++++ packages/formoj/src/components/Form.vue | 28 +++++++++++++++++++------ packages/formoj/src/util/visibility.js | 21 +++++++++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 packages/formoj/src/util/visibility.js diff --git a/packages/formoj/example/data/form.json b/packages/formoj/example/data/form.json index adb4d27..35a65ca 100644 --- a/packages/formoj/example/data/form.json +++ b/packages/formoj/example/data/form.json @@ -50,6 +50,9 @@ "multiple": false, "radios": true, "label": "Genre", + "conditionalDisplay": { + "5": [1] + }, "options": [ { "id": 1, @@ -67,6 +70,9 @@ "id": 2, "title": "Ma section 2", "description": "Deuxième questions", + "conditionalDisplay": { + "8": [1] + }, "fields": [ { "id": 2, diff --git a/packages/formoj/src/components/Form.vue b/packages/formoj/src/components/Form.vue index 8d4ea26..2b2e78b 100644 --- a/packages/formoj/src/components/Form.vue +++ b/packages/formoj/src/components/Form.vue @@ -9,7 +9,7 @@