解决原生组件事件无法穿透
解决无法全屏拖拽组件
解决破坏自身开发代码的结构
解决无法触发下拉刷新和上拉加载的事件
整个小程序每个页面都可以使用
新建项目 -> 导入src文件 -> 预览效果
<div align=center> <img width="270" height="480" src="./screenshot/struct.png"/> <img width="270" height="480" src="./screenshot/index.png"/> <img width="270" height="480" src="./screenshot/logs.jpg"/> </div>
movable.wxml
<movable-area class='movable-box'>
<slot/>
<movable-view
class='movable-btn'
x='{{x}}'
y='{{y}}'
direction='all'
bindtap='goEvt'>
<navigator
target='miniProgram'
open-type='navigate'
app-id=''
path=''
extra-data=''
version='release'>小程序</navigator>
</movable-view>
</movable-area>
movable.wxss
.movable-box {
width: 100vw;
height: 100vh;
}
.movable-btn {
position: fixed;
width: 100rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
background: #ccc;
border-radius: 50%;
font-size: 30rpx;
}
movable.js
let {
windowWidth,
windowHeight
} = wx.getSystemInfoSync()
Component({
properties: {
x: {
type: Number,
value: windowWidth - 70
},
y: {
type: Number,
value: windowHeight - 75
}
}
})
movable.json
{
"component": true
}
1 个评论
支持拖动live-player这样的原生组件吗