From b8a1ea9c8e7da3c24aa12caedf4a4e7dd7182000 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 17 May 2022 00:04:00 +0200 Subject: [PATCH] Remove v-if from tabs in member form --- app/Member/MemberController.php | 2 +- resources/js/components/FSelect.vue | 59 ++++++++++++++++++----------- resources/js/views/member/VForm.vue | 10 ++--- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/app/Member/MemberController.php b/app/Member/MemberController.php index ac3b178c..ce520185 100644 --- a/app/Member/MemberController.php +++ b/app/Member/MemberController.php @@ -103,7 +103,7 @@ class MemberController extends Controller 'regions' => Region::where('is_null', false)->pluck('name', 'id'), 'nationalities' => Nationality::pluck('name', 'id'), 'confessions' => Confession::where('is_null', false)->pluck('name', 'id'), - 'subscriptions' => Subscription::pluck('name', 'id'), + 'subscriptions' => Subscription::select('name', 'id')->get(), 'data' => new MemberResource($member), 'mode' => 'edit', 'conflict' => '1' === $request->query('conflict', '0'), diff --git a/resources/js/components/FSelect.vue b/resources/js/components/FSelect.vue index 376dd4e8..22e9f7ac 100644 --- a/resources/js/components/FSelect.vue +++ b/resources/js/components/FSelect.vue @@ -8,8 +8,11 @@
@@ -34,63 +37,69 @@ export default { props: { disabled: { type: Boolean, - default: function() { return false; } + default: function () { + return false; + }, }, id: {}, inset: { type: Boolean, - default: false + default: false, }, size: { - default: function() { return 'base'; } + default: function () { + return 'base'; + }, }, emptyLabel: { default: false, - type: Boolean + type: Boolean, }, value: { - default: undefined + default: undefined, }, label: { - default: null + default: null, }, required: { type: Boolean, - default: false + default: false, }, placeholder: { default: '--kein--', - type: String + type: String, }, def: { required: false, type: Number, - default: -1 + default: -1, }, hint: {}, options: { - default: function() { return []; } - } + default: function () { + return []; + }, + }, }, computed: { parsedOptions() { return Array.isArray(this.options) ? this.options : map(this.options, (value, key) => { - return {'name': value, id: key}; - }); - } + return {name: value, id: key}; + }); + }, }, methods: { trigger(v) { - this.$emit('input', isNaN(parseInt(v.target.value)) - ? (v.target.value ? v.target.value : null) - : parseInt(v.target.value) + this.$emit( + 'input', + isNaN(parseInt(v.target.value)) ? (v.target.value ? v.target.value : null) : parseInt(v.target.value) ); }, clear() { this.$emit('input', null); - } + }, }, mounted() { if (this.def !== -1 && typeof this.value === 'undefined') { @@ -101,12 +110,18 @@ export default { if (this.placeholder && typeof this.value === 'undefined') { this.$emit('input', null); } - } + }, }; diff --git a/resources/js/views/member/VForm.vue b/resources/js/views/member/VForm.vue index f4f632c3..6595d8bf 100644 --- a/resources/js/views/member/VForm.vue +++ b/resources/js/views/member/VForm.vue @@ -45,7 +45,7 @@
-
+
@@ -95,7 +95,7 @@ >
-
+
@@ -104,7 +104,7 @@
-
+
-
+
@@ -184,7 +184,7 @@ >
-
+