Files
past-go/weapp/components/app-nav/app-nav.js
T
2026-10-07 09:28:43 +08:00

13 lines
502 B
JavaScript

const { getLayout } = require('../../utils/layout');
Component({
properties: { title: String, back: Boolean },
data: { statusBarHeight: 20, barHeight: 44, navSide: 100 },
lifetimes: { attached: function() { this.setData(getLayout()); } },
pageLifetimes: { resize: function() { this.setData(getLayout()); } },
methods: { goBack: function() {
this.triggerEvent('back');
if (getCurrentPages().length > 1) wx.navigateBack();
else wx.reLaunch({ url: '/pages/index/index' });
} }
});