Add existing loading modal to text-links, off by default.
This commit is contained in:
parent
5052e7a18e
commit
8b45d81cf7
1 changed files with 15 additions and 0 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue