Skip to content

fix(drawer): [drawer] modify height props,setting the height of the left and right sliders #2484

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

Merged
merged 1 commit into from
Nov 5, 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
2 changes: 1 addition & 1 deletion examples/sites/demos/apis/drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default {
{
name: 'height',
type: 'string',
defaultValue: "'500px'",
defaultValue: "'100vh'",
desc: {
'zh-CN': '设置抽屉的高度',
'en-US': 'Set the height of the drawer'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
:visible="visible"
@update:visible="visible = $event"
@drag="drag"
height="600px"
>
<div class="content">
<div>
<p v-if="placement === 'right'">横向拖拽左边框可改变抽屉主体宽度。</p>
<p v-else>竖向拖拽上边框可改变抽屉主体高度。</p>
</div>
Expand All @@ -35,9 +36,3 @@ const drag = ({ width, height }) => {
TinyModal.message({ message: `抽屉的宽为${width},高为${height}`, status: 'info' })
}
</script>

<style scoped>
.content {
height: 300px;
}
</style>
9 changes: 2 additions & 7 deletions examples/sites/demos/pc/app/drawer/dragable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
:visible="visible"
@update:visible="visible = $event"
@drag="drag"
height="600px"
>
<div class="content">
<div>
<p v-if="placement === 'right'">横向拖拽左边框可改变抽屉主体宽度。</p>
<p v-else>竖向拖拽上边框可改变抽屉主体高度。</p>
</div>
Expand Down Expand Up @@ -44,9 +45,3 @@ export default {
}
}
</script>

<style scoped>
.content {
height: 300px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
title="标题"
:placement="placement"
v-model:visible="visible"
height="600px"
>
<div>left或者right内容区域</div>
</tiny-drawer>
Expand Down
1 change: 1 addition & 0 deletions examples/sites/demos/pc/app/drawer/placement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
title="标题"
:placement="placement"
v-model:visible="visible"
height="600px"
>
<div>left或者right内容区域</div>
</tiny-drawer>
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/drawer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const $constants = {
return (scrollLockClasses[mode] || '') as string
},
DEFAULT_WIDTH: '500px',
DEFAULT_HEIGHT: '500px'
DEFAULT_HEIGHT: '100vh'
}

export const drawerProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/drawer/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
]"
:style="{
width: ['left', 'right'].includes(placement) ? state.computedWidth : null,
height: ['top', 'bottom'].includes(placement) || dragable ? state.computedHeight : null,
height: ['top', 'bottom', 'left', 'right'].includes(placement) || dragable ? state.computedHeight : null,
zIndex
}"
v-show="state.visible"
Expand Down
Loading