Skip to content

Commit 405a278

Browse files
committed
fix: modify demo
1 parent e4ffe3c commit 405a278

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/sites/demos/pc/app/dialog-box/lock-scroll.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<tiny-button @click="openDlg(true)" type="info">允许滚动背景</tiny-button>
44
<tiny-button @click="openDlg(false)">不允许滚动背景</tiny-button>
5-
<tiny-dialog-box :lock-scroll="false" v-model:visible="visible1" title="消息" width="30%">
5+
<tiny-dialog-box :lock-scroll="false" v-model:visible="visible1" title="消息" width="30%" @close="closeDlg(true)">
66
<span>允许被遮罩内容的滚动</span>
77
<template #footer>
88
<tiny-button type="primary" @click="closeDlg(true)">确 定</tiny-button>
@@ -35,21 +35,21 @@ export default {
3535
openDlg(isScroll) {
3636
if (isScroll) {
3737
document.body.style.overflow = 'auto'
38-
document.body.style.height = '200vh'
39-
this.visible1 = true
38+
document.body.style.height = '130vh'
39+
visible1.value = true
4040
} else {
41-
document.body.style.height = '200vh'
42-
this.visible2 = true
41+
document.body.style.overflow = 'hidden'
42+
document.body.style.height = '100vh'
43+
visible2.value = true
4344
}
4445
},
4546
closeDlg(isScroll) {
4647
if (isScroll) {
4748
document.body.style.overflow = 'hidden'
4849
document.body.style.height = '100vh'
49-
this.visible1 = false
50+
visible1.value = false
5051
} else {
51-
document.body.style.height = '100vh'
52-
this.visible2 = false
52+
visible2.value = false
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)