feat:重构按钮和icon组件
This commit is contained in:
@@ -9,13 +9,25 @@ Component({
|
||||
data: {
|
||||
statusBarHeight: 0,
|
||||
navBlockHeight: 0,
|
||||
showBackButton: false,
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
const { statusBarHeight } = wx.getWindowInfo();
|
||||
const pages = getCurrentPages();
|
||||
this.setData({
|
||||
statusBarHeight,
|
||||
navBlockHeight: statusBarHeight + NAV_INNER_PX,
|
||||
showBackButton: pages.length > 1,
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleBack() {
|
||||
wx.navigateBack({
|
||||
fail: () => {
|
||||
wx.switchTab({ url: '/pages/home/home' });
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user