Skip to content

Commit

Permalink
fix: modify height props
Browse files Browse the repository at this point in the history
  • Loading branch information
James-9696 committed Nov 5, 2024
1 parent 7f93ca9 commit d3506dd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
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

0 comments on commit d3506dd

Please sign in to comment.