dm-wechat-mini/components/navbar/index.js
2025-02-22 03:14:42 +08:00

56 lines
838 B
JavaScript

// components/navBar.js
Component({
/**
* 组件的属性列表
*/
properties:{
back:{
type:Boolean,
value:false
},
backTitle:{
type:String,
value:''
},
share:{
type:Boolean,
value:false
},
background:{
type:String,
value:''
}
},
/**
* 组件的初始数据
*/
data: {
statusBarHeight:0,
navBarHeight:44
},
lifetimes:{
attached(){
console.log('1212121212');
const windowInfo = wx.getWindowInfo();
this.setData({
statusBarHeight:windowInfo.statusBarHeight
})
}
},
/**
* 组件的方法列表
*/
methods: {
back(){
wx.navigateBack();
},
share(){
},
getHeight(){
return this.data.statusBarHeight + this.data.navBarHeight;
}
}
})