mms-sticky-bottom 粘性底部
简述
固定在窗口底部,适配 iPhone 安全区域。
注意
注意: 请以 uni_modules/mms-unix 与本文为准;各端差异以 uni-app 与各平台官方文档为准。涉及隐私能力(相册、定位、剪贴板、手机号等)需在 manifest 与后台完成配置。
平台差异说明
| App(vue) | App(nvue) | H5 | 小程序 |
|---|---|---|---|
| √ | √ | √ | √ |
基本使用
uvue
<template>
<view>
<mms-sticky-bottom>
<mms-button type="primary" text="提交"></mms-button>
</mms-sticky-bottom>
</view>
</template>Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
zIndex | 层级 | number | 998 |
safeAreaInsetBottom | 是否适配底部安全区域 | boolean | true |
bgColor | 背景颜色 | string | #ffffff |
插槽
| 名称 | 说明 |
|---|---|
default | 底部内容 |
示例
按钮放在粘性底部
uvue
<mms-sticky-bottom>
<mms-button type="primary" text="确认提交" @click="submit"></mms-button>
</mms-sticky-bottom>自定义背景色
uvue
<mms-sticky-bottom bgColor="#f5f5f5">
<mms-button type="primary" text="确认提交"></mms-button>
</mms-sticky-bottom>