From 99afd2e830e3071742665fbb15731f87902cb074 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 14 Feb 2022 22:03:11 +0100 Subject: [PATCH] OnTheFly: set a dynamic default --- .../Resources/public/vuejs/OnTheFly/components/Create.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue index d9f821600..d242037b8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue @@ -50,7 +50,7 @@ export default { }, data() { return { - type: 'person' //by default + type: null } }, computed: { @@ -62,7 +62,10 @@ export default { get() { return this.type; } - } + }, + }, + mounted() { + this.type = (this.allowedTypes.length === 1 && this.allowedTypes.includes('thirdparty')) ? 'thirdparty' : 'person' }, methods: { isActive(tab) {