Skip to content

m-sticky-bottom 粘性底部

简述

固定在窗口底部,适配 iPhone 安全区域。

注意

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

平台差异说明

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

演示地址

与线上 H5 演示基座 分包一致(文档站右下角预览 iframe 亦指向同一路径)。

类型地址
分包路径pages_demo/ext/sticky/sticky
线上 H5(hash)打开演示

基本使用

uvue
<template>
	<view>
		<m-sticky-bottom>
			<m-button type="primary">提交</m-button>
		</m-sticky-bottom>
	</view>
</template>

Props

参数说明类型默认值
zIndex层级number998
safeAreaInsetBottom是否适配底部安全区域booleantrue
bgColor背景颜色string#ffffff

插槽

名称说明
default底部内容

示例

按钮放在粘性底部

uvue
<m-sticky-bottom>
	<m-button type="primary" @click="submit">确认提交</m-button>
</m-sticky-bottom>

自定义背景色

uvue
<m-sticky-bottom bgColor="#f5f5f5">
	<m-button type="primary">确认提交</m-button>
</m-sticky-bottom>

Released under the MIT License.