更新记录
0.0.2(2023-11-21) 下载此版本
增加bottom-px
0.0.1(2023-11-20) 下载此版本
可拖拽悬浮按钮
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | - | √ | √ | √ | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | - | √ | √ | √ | √ |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
√ | × | × |
使用注意
-
属性名 类型 默认值 说明 isDock Boolean false 是否自动停靠 existTabBar Boolean false 当前页面是否包含tabbar bottomPx Number 0 按钮默认位置离底部距离(px) @btnClick EventHandle 点击事件 @btnTouchstart EventHandle 拖拽开始事件 @btnTouchend EventHandle 拖拽结束事件 -
示例代码
<template> <view class="content"> <cls-DragBtn is-dock @btnClick="btn_click" @btnTouchstart="touch_start" @btnTouchend="touch_end" :bottom-px="100"> <image src="/static/scan.png" style="width: 100rpx;" mode="widthFix" ></image> <!-- <button>1132</button> --> </cls-DragBtn> </view> </template> <script> export default { methods: { btn_click() { console.log('btn_click1'); }, touch_start(){ console.log('开始拖拽'); }, touch_end(){ console.log('拖拽结束'); } } } </script>