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