modal seems to be working, needs more testing
This commit is contained in:
parent
350ddb1e6d
commit
93d21ff081
2 changed files with 28 additions and 13 deletions
|
|
@ -48,6 +48,7 @@ import { useForm } from "vee-validate";
|
||||||
export default {
|
export default {
|
||||||
name: "modal",
|
name: "modal",
|
||||||
props: {
|
props: {
|
||||||
|
modalId: String,
|
||||||
headerText: String,
|
headerText: String,
|
||||||
footerButtonText: String,
|
footerButtonText: String,
|
||||||
onModalOpenedCallback: {
|
onModalOpenedCallback: {
|
||||||
|
|
@ -57,8 +58,8 @@ export default {
|
||||||
type: Function,
|
type: Function,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup(props) {
|
||||||
const modalId = `modal-${crypto.randomUUID()}`;
|
const modalId = props.modalId ? props.modalId : `modal-${crypto.randomUUID()}`;
|
||||||
|
|
||||||
const { meta, validate, resetForm } = useForm();
|
const { meta, validate, resetForm } = useForm();
|
||||||
|
|
||||||
|
|
@ -113,6 +114,7 @@ export default {
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.modal {
|
.modal {
|
||||||
|
overflow: hidden;
|
||||||
top: auto;
|
top: auto;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
h5,
|
h5,
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,16 @@
|
||||||
<siteHeader cmsWidgetName="SiteHeaderWidget"/>
|
<siteHeader cmsWidgetName="SiteHeaderWidget"/>
|
||||||
<div class="fade-on-route-transition overflow-scroll container">
|
<div class="fade-on-route-transition overflow-scroll container">
|
||||||
|
|
||||||
<div class="row mt-4 position-sticky top-100" id="welcomeFooter">
|
<div class="row mt-4 position-sticky top-100">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p @click="() => this.openModal('TestModal')" class="small">
|
<p @click='() => openModal("TestModal")' class="small">
|
||||||
|
here
|
||||||
|
</p>
|
||||||
|
<p @click='() => openModal("ModalName")'>
|
||||||
here
|
here
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<contentGroupModal cmsWidgetName="TestModal"
|
<a href="#!" data-bs-toggle="modal" data-bs-target="#ModalName" aria-label="Modal window">Wow!!</a>
|
||||||
:ref="TestModal"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<siteFooter
|
<siteFooter
|
||||||
cmsWidgetName="SiteFooterWidget"
|
cmsWidgetName="SiteFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
|
@ -26,13 +26,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<contentGroupModal cmsWidgetName="TestModal"
|
||||||
|
ref="TestModal"
|
||||||
|
/>
|
||||||
|
<modal
|
||||||
|
ref="ModalName"
|
||||||
|
modalId="ModalName"
|
||||||
|
footerButtonText="test"
|
||||||
|
:onModalClosedCallback="clickModalButton">
|
||||||
|
<p>I'm a modal!</p>
|
||||||
|
</modal>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import siteHeader from '@/iss-components/site-header/site-header';
|
import siteHeader from '@/iss-components/site-header/site-header';
|
||||||
import siteFooter from "@/iss-components/site-footer/site-footer";
|
import siteFooter from "@/iss-components/site-footer/site-footer";
|
||||||
|
import modal from "@/digital-components/modal/modal";
|
||||||
|
|
||||||
import contentGroupModal from "@/iss-components/content-group-modal/content-group-modal"
|
import contentGroupModal from "@/iss-components/content-group-modal/content-group-modal"
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
|
|
@ -46,11 +56,13 @@
|
||||||
export default {
|
export default {
|
||||||
name: "z-test-page-jg",
|
name: "z-test-page-jg",
|
||||||
mixins: [BaseFormMixin],
|
mixins: [BaseFormMixin],
|
||||||
method: {
|
methods: {
|
||||||
openModal(modalName) {
|
openModal(modalName) {
|
||||||
console.log("here")
|
|
||||||
this.$refs[modalName].openModal();
|
this.$refs[modalName].openModal();
|
||||||
},
|
},
|
||||||
|
clickModalButton() {
|
||||||
|
alert("you clicked me!");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bodyText() {
|
bodyText() {
|
||||||
|
|
@ -81,7 +93,8 @@ export default {
|
||||||
siteHeader,
|
siteHeader,
|
||||||
siteFooter,
|
siteFooter,
|
||||||
Form,
|
Form,
|
||||||
contentGroupModal
|
contentGroupModal,
|
||||||
|
modal
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in a new issue