From 94e626a46092ff4be0a190d046c91326a779e9fb Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 26 Jun 2024 13:20:09 +0200 Subject: [PATCH] feat: use dataKey prop when same url --- src/components/common/VnSelect.vue | 6 +++++- src/pages/Customer/Card/CustomerBasicData.vue | 4 ++-- src/pages/Customer/Defaulter/CustomerDefaulterFilter.vue | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index b9e6c6070..976e949c8 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -21,6 +21,10 @@ const $props = defineProps({ type: String, default: 'id', }, + dataKey: { + type: String, + default: null, + }, optionFilter: { type: String, default: null, @@ -89,7 +93,7 @@ const useURL = computed(() => $props.url); import { useAttrs } from 'vue'; const $attrs = useAttrs(); -const arrayDataKey = $props.url !== '' ? $props.url : $attrs.label; +const arrayDataKey = $props.dataKey ?? ($props.url !== '' ? $props.url : $attrs.label); const arrayDataOptions = { url: $props.url, where: $props.where, diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index 9f0b260a6..46aab204c 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -13,7 +13,6 @@ import VnSelect from 'src/components/common/VnSelect.vue'; const route = useRoute(); const { t } = useI18n(); -const workers = ref([]); const businessTypes = ref([]); const contactChannels = ref([]); @@ -99,10 +98,11 @@ const contactChannels = ref([]);