wuqy-component
Version:
这是一个微信小程序自定义组件库
46 lines (39 loc) • 1.01 kB
text/typescript
// components/backAndTitle/index.ts
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
goBack() {
this.getAppBar().x()
},
},
lifetimes: {
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function () {
const appExample = getApp();
this.setData({
//胶囊菜单信息
menuInfo: appExample.menuInfo,
//back-title组件下边缘距屏幕顶部的距离,50px是组件的高度。
titleBottom: appExample.menuInfo.top + 50,
//除去顶部组件屏幕剩余的高度
residualHeight: appExample.WinInfo.screenHeight - (appExample.menuInfo.top + 50),
//屏幕高度
screenHeight: appExample.WinInfo.screenHeight,
})
},
moved: function () { },
detached: function () { },
},
})