File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
examples/sites/demos/pc/app/dialog-box Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 2
2
<div >
3
3
<tiny-button @click =" openDlg(true)" type =" info" >允许滚动背景</tiny-button >
4
4
<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) " >
6
6
<span >允许被遮罩内容的滚动</span >
7
7
<template #footer >
8
8
<tiny-button type =" primary" @click =" closeDlg(true)" >确 定</tiny-button >
@@ -35,21 +35,21 @@ export default {
35
35
openDlg(isScroll) {
36
36
if (isScroll) {
37
37
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
40
40
} 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
43
44
}
44
45
},
45
46
closeDlg(isScroll) {
46
47
if (isScroll) {
47
48
document.body.style.overflow = 'hidden'
48
49
document.body.style.height = '100vh'
49
- this. visible1 = false
50
+ visible1.value = false
50
51
} else {
51
- document.body.style.height = '100vh'
52
- this.visible2 = false
52
+ visible2.value = false
53
53
}
54
54
}
55
55
}
You can’t perform that action at this time.
0 commit comments