Skip to content

Commit

Permalink
feat: ActionSheet 可以配置最大高度吗, 我当做 select使用了。 #445
Browse files Browse the repository at this point in the history
  • Loading branch information
jry committed Jul 27, 2024
1 parent 1cdb600 commit c55420e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
30 changes: 30 additions & 0 deletions src/pages/componentsB/actionSheet/actionSheet.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,36 @@
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项2',
},
{
name: '选项3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ export const props = defineMixin({
round: {
type: [Boolean, String, Number],
default: () => defProps.actionSheet.round
}
},
// 选项区域最大高度
wrapMaxHeight: {
type: [String],
default: () => defProps.actionSheet.wrapMaxHeight
},
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
>{{description}}</text>
<slot>
<u-line v-if="description"></u-line>
<view class="u-action-sheet__item-wrap">
<scroll-view scroll-y class="u-action-sheet__item-wrap" :style="{maxHeight: wrapMaxHeight}">
<view :key="index" v-for="(item, index) in actions">
<!-- #ifdef MP -->
<button
Expand Down Expand Up @@ -85,7 +85,7 @@
<!-- #endif -->
<u-line v-if="index !== actions.length - 1"></u-line>
</view>
</view>
</scroll-view>
</slot>
<u-gap
bgColor="#eaeaec"
Expand Down Expand Up @@ -270,7 +270,7 @@
font-size: $u-action-sheet-cancel-text-font-size;
color: $u-action-sheet-cancel-text-color;
text-align: center;
padding: $u-action-sheet-cancel-text-font-size;
// padding: $u-action-sheet-cancel-text-font-size;
}
&--hover {
Expand Down
3 changes: 2 additions & 1 deletion src/uni_modules/uview-plus/libs/config/props/actionSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
safeAreaInsetBottom: true,
openType: '',
closeOnClickOverlay: true,
round: 0
round: 0,
wrapMaxHeight: '600px'
}
}

0 comments on commit c55420e

Please sign in to comment.