add Overlay: 禁用页面鼠标
This commit is contained in:
45
src/components/Overlay.vue
Normal file
45
src/components/Overlay.vue
Normal file
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<div class="overlay-view">
|
||||
<h1>请稍后......</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "OverlayView",
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
mounted() {
|
||||
// 禁止页面滚动
|
||||
document.body.style.overflow = 'hidden'
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.body.style.overflow = 'unset'
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.overlay-view {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
cursor: wait;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000000;
|
||||
}
|
||||
|
||||
.overlay-view h1 {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
font-size: 36px;
|
||||
font-weight: bold;
|
||||
letter-spacing: 10px;
|
||||
color: #cccc;
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user