From eea8444bb867c4da93109d6ef26e115013e3a59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Viricel?= Date: Wed, 14 Feb 2024 17:08:38 +0100 Subject: [PATCH] feat: add website field with prefix/suffix support #164 --- components/Fields/Field.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/components/Fields/Field.vue b/components/Fields/Field.vue index 1bab39e3f..8d81cc675 100644 --- a/components/Fields/Field.vue +++ b/components/Fields/Field.vue @@ -13,6 +13,7 @@ import OpeningHours, { isOpeningHoursSupportedOsmTags } from '~/components/Field import Phone from '~/components/Fields/Phone.vue' import RoutesField, { isRoutesFieldEmpty } from '~/components/Fields/RoutesField.vue' import Stars from '~/components/Fields/Stars.vue' +import Website from '~/components/Fields/Website.vue' import ExternalLink from '~/components/UI/ExternalLink.vue' import FieldsHeader from '~/components/UI/FieldsHeader.vue' import type { ApiPoiProperties, FieldsListItem } from '~/lib/apiPois' @@ -49,6 +50,7 @@ export default defineNuxtComponent({ Instagram, ExternalLink, Stars, + Website, }, emits: { @@ -94,6 +96,9 @@ export default defineNuxtComponent({ shortDescription(): string | undefined { return this.properties?.description?.replace(/(<([^>]+)>)/gi, '') }, + isWebsite(): boolean { + return /\w*:?website:?\w*/.test(this.field.field) + }, }, methods: { @@ -222,15 +227,7 @@ export default defineNuxtComponent({ -
- - {{ item }} - -
+