Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
6de8687be1
|
@ -2,7 +2,7 @@
|
||||||
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
import CreateNewPostcode from 'src/components/CreateNewPostcodeForm.vue';
|
||||||
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
import VnSelectDialog from 'components/common/VnSelectDialog.vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { computed } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useAttrs } from 'vue';
|
import { useAttrs } from 'vue';
|
||||||
import { useRequired } from 'src/composables/useRequired';
|
import { useRequired } from 'src/composables/useRequired';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -16,6 +16,14 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.location,
|
||||||
|
(newValue) => {
|
||||||
|
if (!modelValue.value) return;
|
||||||
|
modelValue.value = formatLocation(newValue) ?? null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const mixinRules = [requiredFieldRule];
|
const mixinRules = [requiredFieldRule];
|
||||||
const locationProperties = [
|
const locationProperties = [
|
||||||
'postcode',
|
'postcode',
|
||||||
|
@ -43,9 +51,7 @@ const formatLocation = (obj, properties = locationProperties) => {
|
||||||
return filteredParts.join(', ');
|
return filteredParts.join(', ');
|
||||||
};
|
};
|
||||||
|
|
||||||
const modelValue = computed(() =>
|
const modelValue = ref(props.location ? formatLocation(props.location) : null);
|
||||||
props.location ? formatLocation(props.location, locationProperties) : null
|
|
||||||
);
|
|
||||||
|
|
||||||
function showLabel(data) {
|
function showLabel(data) {
|
||||||
const dataProperties = [
|
const dataProperties = [
|
||||||
|
|
Loading…
Reference in New Issue