Skip to content

Commit 95ab375

Browse files
committed
Vue show modal method
1 parent 299b16f commit 95ab375

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/components/shared/Header.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@
9595
</div>
9696
</div>
9797

98+
<!-- Hire me modal start -->
9899
<transition name="fade">
99100
<div v-show="show_modal" class="fixed inset-0 z-30">
100-
<!-- background -->
101+
<!-- background -->
101102
<div
102103
v-show="show_modal"
103104
@click="showModal()"
@@ -153,6 +154,7 @@
153154
</main>
154155
</div>
155156
</transition>
157+
<!-- Hire me modal end -->
156158
</nav>
157159
</template>
158160

@@ -168,6 +170,7 @@ export default {
168170
return {
169171
isOpen: false,
170172
theme: '',
173+
modal: true,
171174
};
172175
},
173176
@@ -182,6 +185,20 @@ export default {
182185
updateTheme(theme) {
183186
this.theme = theme;
184187
},
188+
showModal() {
189+
if (this.show_modal) {
190+
//stop screen scrolling
191+
document
192+
.getElementsByTagName('html')[0]
193+
.classList.remove('overflow-y-hidden');
194+
this.show_modal = false;
195+
} else {
196+
document
197+
.getElementsByTagName('html')[0]
198+
.classList.add('overflow-y-hidden');
199+
this.show_modal = true;
200+
}
201+
},
185202
},
186203
updated() {
187204
feather.replace();

0 commit comments

Comments
 (0)