Skip to content

mms-popup 弹出层

简述

弹出层容器,用于展示弹窗、菜单等内容,支持从顶部、底部、中间弹出。

注意

注意: 请以 uni_modules/mms-unix 与本文为准;各端差异以 uni-app 与各平台官方文档为准。涉及隐私能力(相册、定位、剪贴板、手机号等)需在 manifest 与后台完成配置。

平台差异说明

App(vue)App(nvue)H5小程序

基本使用

uvue
<template>
	<view>
		<mms-popup
			:show="show"
			position="bottom"
			round
			closeable
			@close="show = false"
		>
			<view>
				<text>弹出内容</text>
			</view>
		</mms-popup>
	</view>
</template>

Props

参数说明类型默认值
show是否显示弹出层booleanfalse
position弹出位置 top / center / bottomstringbottom
round是否显示圆角booleantrue
overlayOpacity遮罩透明度number0.5
closeable是否显示关闭按钮booleanfalse
closeOnClickOverlay点击遮罩是否关闭booleantrue
zIndex层级number999
maxHeight最大高度,单位 vhnumber80

Events

事件名说明
close关闭弹出层时触发
overlay-click点击遮罩触发

插槽

名称说明
default弹出层内容

示例

底部弹出

uvue
<mms-popup
	:show="show"
	position="bottom"
	round
	closeable
	@close="show = false"
>
	<view>
		<text>底部弹出内容</text>
	</view>
</mms-popup>

中间弹出弹窗

uvue
<mms-popup
	:show="show"
	position="center"
	round
>
	<view class="dialog">
		<text>弹窗内容</text>
	</view>
</mms-popup>

Released under the MIT License.