diff --git a/packages/vue/lib/main.ts b/packages/vue/lib/main.ts index 5c99197f..fe21b882 100644 --- a/packages/vue/lib/main.ts +++ b/packages/vue/lib/main.ts @@ -76,7 +76,6 @@ import BlockStreamfield from './../src/components/BlockStreamfield/BlockStreamfi import BlockTable from './../src/components/BlockTable/BlockTable.vue' import BlockTeaser from './../src/components/BlockTeaser/BlockTeaser.vue' import BlockText from './../src/components/BlockText/BlockText.vue' -import BlockTwitterEmbed from './../src/components/BlockTwitterEmbed/BlockTwitterEmbed.vue' import BlockVideo from './../src/components/BlockVideo/BlockVideo.vue' import BlockVideoEmbed from './../src/components/BlockVideoEmbed/BlockVideoEmbed.vue' import CalendarButton from './../src/components/CalendarButton/CalendarButton.vue' @@ -280,7 +279,6 @@ export { BlockTable, BlockTeaser, BlockText, - BlockTwitterEmbed, BlockVideo, BlockVideoEmbed, CalendarButton, diff --git a/packages/vue/src/components/BaseButton/BaseButton.vue b/packages/vue/src/components/BaseButton/BaseButton.vue index 7677f00e..ba4ea95e 100644 --- a/packages/vue/src/components/BaseButton/BaseButton.vue +++ b/packages/vue/src/components/BaseButton/BaseButton.vue @@ -75,6 +75,14 @@ export default defineComponent({ } return undefined }, + computedTo() { + let toValue = this.to + // filter out unnecessary `/home/` prefix from wagtail default site urlPaths + if (toValue && typeof toValue === 'string' && toValue.startsWith('/home/')) { + toValue = toValue.replace('/home/', '/') + } + return toValue + }, variantClass(): string { let classes = variants[this.variant] if (!this.$slots.default && this.$slots.icon) { @@ -99,7 +107,7 @@ export default defineComponent({ :aria-label="ariaLabel" :disabled="disabled" :href="theHref" - :to="to ? to : undefined" + :to="computedTo ? computedTo : undefined" @click="$emit('click')" > diff --git a/packages/vue/src/components/BlockRelatedLinks/BlockRelatedLinks.vue b/packages/vue/src/components/BlockRelatedLinks/BlockRelatedLinks.vue index 3974166c..915e3864 100644 --- a/packages/vue/src/components/BlockRelatedLinks/BlockRelatedLinks.vue +++ b/packages/vue/src/components/BlockRelatedLinks/BlockRelatedLinks.vue @@ -8,12 +8,12 @@ > {{ data.heading }} -