更新记录

1.0.1(2025-04-18) 下载此版本

更新

1.0.0(2025-04-18) 下载此版本

初次发布


平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.1.0 app-vue × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序 鸿蒙元服务
× × × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × ×

npm下载量:downloads

欢迎使用 c-bottom-fixed

安装

// npm安装方式,插件市场导入无需执行此命令。插件市场导入地址:
npm i c-bottom-fixed

使用方法

<template>
    <view class="box">
        <c-bottom-fixed ref="bottomFixed">
            <template #box>
                <view class="" style="height: 100vh;background-color: #fff;">
                    666
                </view>
            </template>
            <template #bottom>
                <view class="" style="display: flex;padding: 30rpx;" v-if="showBottom">
                    <button>按钮1</button>
                    <button>按钮2</button>
                    <button>按钮3</button>
                </view>
            </template>
        </c-bottom-fixed>
    </view>
</template>

<script>
    // 以下导入方式按照安装方式导入,二选一
    // 插件市场导入方法:无需引入,可直接使用
    // npm导入方法如下:
    import cBottomFixed from "c-bottom-fixed/components/c-bottom-fixed/c-bottom-fixed.vue";
    export default {
        // npm导入需要添加components,插件市场导入不需要
        components: {
            cBottomFixed
        },
        data() {
            return {
                showBottom: false
            }
        },
        onLoad() {
            this.getData();
        },
        methods: {
            // 模拟请求调用
            getData() {
                setTimeout(() => {
                    this.showBottom = true;
                    this.$nextTick(function() {
                        // 底部已经完全显示出来
                        this.$refs.bottomFixed.getBottom();
                    })
                }, 3000)
            }
        }
    }
</script>

API

Props

参数 说明 类型 默认值 可选值
safe-area-inset-bottom 是否开启底部安全区适配,c-bottom-fixed外层没有设置,需要开启 Boolean false true
box-style 盒子样式 Object {} -
bottom-bg 底部背景色 String #fff -
bottom-shadow 底部阴影 String 0 -2rpx 20rpx -16rpx rgba(0, 0, 0, 0.3) -
bottom-zindex 底部层级 String 0 -2rpx 20rpx -16rpx rgba(0, 0, 0, 0.3) -
bottom-style 底部样式 Object {} -
box-bottom-gap 盒子和底部之间的间隙,单位rpx String|Number 20 -

Methods,需要通过ref手动调用

事件名 说明 回调参数
getBottom 底部盒子内容变化时调用 -

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问