Skip to content

基础使用

通过 show 属性控制组件的显示/隐藏。
弹出层点后后会提交一个 close 事件,需自行处理关闭逻辑将 show 设置为 false 以关闭弹出层。
通过 title 设置组件的标题
通过默认 slot 设置组件的内容。

vue
<hi-popup :show="isShow" title="标题">
    <view class="content">弹窗内容</view>
</hi-popup>

内容显示位置

通过 mode、属性设置内容的显示位置,可选的值有:center(默认)topbottomleftright

vue
<hi-popup :show="isShow" title="标题" mode="bottom">
    <view class="content">弹窗内容</view>
</hi-popup>

Props

参数说明类型默认值可选值
hoverClass关闭点击时的 hover-classStringhi-hover-
show显示状态Booleanfalse-
mode内容显示模式Stringcentercentertopbottomleftright
showHeader是否显示 Header(标题+关闭)Booleantrue-
title标题String--
showClose是否显示关闭按钮Booleantrue-
closeIconName关闭图标名称String__shanchu-
showFooter是否显示 FooterBooleantrue-
height内容高度String--
maxHeight内容最大高度String--
width内容宽度String--
maxWidth内容最大宽度String--
showMask是否显示遮罩Booleantrue-
maskClickable遮罩是否可点击Booleanfalse-

Events

具体事件说明请参考:uni-app scroll-view 官方文档

事件名说明回调参数
@close 关闭事件-
@scrolltolower滚动到底部时触发-
@scroll滚动时触发-

Slot

slot说明
#header顶部内容
#footer底部内容
#default默认内容
#title标题内容
#close关闭按钮