Add existing loading modal to text-links, off by default.

This commit is contained in:
Chloe Herd 2023-08-24 15:23:24 -04:00
parent 5052e7a18e
commit 8b45d81cf7

View file

@ -1,4 +1,5 @@
<template>
<loadingModal v-if="displayLoadingModal" ref="loadingModal" />
<a v-if="linkType === 'navigation'" @click="handleClick" class="navigation-link" :href="href"
>{{ text }}<slot name="after-text"></slot
></a>
@ -19,6 +20,8 @@
</template>
<script>
import loadingModal from "@/fmg-components/loading-modal/loading-modal";
export default {
name: "textLink",
props: {
@ -27,6 +30,10 @@ export default {
href: {
type: String,
},
displayLoadingModal: {
type: Boolean,
default: false,
},
},
methods: {
handleClick(event) {
@ -36,9 +43,17 @@ export default {
this.text,
true
);
if (this.displayLoadingModal) {
this.$refs.loadingModal.showModal();
}
this.$emit("click-event");
},
},
components: {
loadingModal,
},
};
</script>