效果图
参考:movable-view
实例- app.js
//app.js
App({
onLaunch: function () {
console.log('App Launch')
},
onShow: function () {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
globalData: {
hasLogin: false
}
})
- app.json
{
"pages": [
"pages/movable/movable"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
- movable.js
Page({
data: {
x: 0,
y: 0
},
tap: function (e) {
this.setData({
x: 30,
y: 30
});
},
onChange: function (e) {
console.log('this is touch change');
console.log(e.detail)
},
onScale: function (e) {
console.log('this is scale change');
console.log(e.detail)
}
})
- movable.json
{
"navigationBarTitleText": "movable-view组件"
}
- movable.wxml
movable-view区域小于movable-area
关注
打赏