Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dialog-box): [dialog-box] modify dialog-box of demo design bug #2382

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<tiny-button @click="boxVisibility = true">无标题</tiny-button>
<tiny-dialog-box :show-header="false" v-model:visible="boxVisibility" title="消息" width="30%">
<span>隐藏弹窗的标题部分</span>
<div class="body-class">隐藏弹窗的标题部分</div>
<template #footer>
<tiny-button type="primary" @click="boxVisibility = false">确 定</tiny-button>
</template>
Expand All @@ -16,3 +16,9 @@ import { Button as TinyButton, DialogBox as TinyDialogBox } from '@opentiny/vue'

const boxVisibility = ref(false)
</script>

<style scoped>
.body-class {
margin-top: 32px;
}
</style>
8 changes: 7 additions & 1 deletion examples/sites/demos/pc/app/dialog-box/hidden-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<tiny-button @click="boxVisibility = true">无标题</tiny-button>
<tiny-dialog-box :show-header="false" v-model:visible="boxVisibility" title="消息" width="30%">
<span>隐藏弹窗的标题部分</span>
<div class="body-class">隐藏弹窗的标题部分</div>
<template #footer>
<tiny-button type="primary" @click="boxVisibility = false">确 定</tiny-button>
</template>
Expand All @@ -25,3 +25,9 @@ export default {
}
}
</script>

<style scoped>
.body-class {
margin-top: 32px;
}
</style>
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 All @@ -27,10 +27,11 @@ const visible2 = ref(false)
function openDlg(isScroll) {
if (isScroll) {
document.body.style.overflow = 'auto'
document.body.style.height = '200vh'
document.body.style.height = '130vh'
visible1.value = true
} else {
document.body.style.height = '200vh'
document.body.style.overflow = 'hidden'
document.body.style.height = '100vh'
James-9696 marked this conversation as resolved.
Show resolved Hide resolved
visible2.value = true
}
}
Expand All @@ -41,7 +42,6 @@ function closeDlg(isScroll) {
document.body.style.height = '100vh'
visible1.value = false
} else {
document.body.style.height = '100vh'
visible2.value = false
}
}
Expand Down
8 changes: 4 additions & 4 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,10 +35,11 @@ export default {
openDlg(isScroll) {
if (isScroll) {
document.body.style.overflow = 'auto'
document.body.style.height = '200vh'
document.body.style.height = '130vh'
this.visible1 = true
} else {
document.body.style.height = '200vh'
document.body.style.overflow = 'hidden'
document.body.style.height = '100vh'
this.visible2 = true
}
},
Expand All @@ -48,7 +49,6 @@ export default {
document.body.style.height = '100vh'
this.visible1 = false
} else {
document.body.style.height = '100vh'
this.visible2 = false
}
}
Expand Down
Loading