Skip to content

Commit

Permalink
fix: modify demo
Browse files Browse the repository at this point in the history
  • Loading branch information
James-9696 committed Oct 24, 2024
1 parent e4ffe3c commit 405a278
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/sites/demos/pc/app/dialog-box/lock-scroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<tiny-button @click="openDlg(true)" type="info">允许滚动背景</tiny-button>
<tiny-button @click="openDlg(false)">不允许滚动背景</tiny-button>
<tiny-dialog-box :lock-scroll="false" v-model:visible="visible1" title="消息" width="30%">
<tiny-dialog-box :lock-scroll="false" v-model:visible="visible1" title="消息" width="30%" @close="closeDlg(true)">
<span>允许被遮罩内容的滚动</span>
<template #footer>
<tiny-button type="primary" @click="closeDlg(true)">确 定</tiny-button>
Expand Down Expand Up @@ -35,21 +35,21 @@ export default {
openDlg(isScroll) {
if (isScroll) {
document.body.style.overflow = 'auto'
document.body.style.height = '200vh'
this.visible1 = true
document.body.style.height = '130vh'
visible1.value = true
} else {
document.body.style.height = '200vh'
this.visible2 = true
document.body.style.overflow = 'hidden'
document.body.style.height = '100vh'
visible2.value = true
}
},
closeDlg(isScroll) {
if (isScroll) {
document.body.style.overflow = 'hidden'
document.body.style.height = '100vh'
this.visible1 = false
visible1.value = false
} else {
document.body.style.height = '100vh'
this.visible2 = false
visible2.value = false
}
}
}
Expand Down

0 comments on commit 405a278

Please sign in to comment.