123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // components/navbar/navbar.ts
- // 获取应用实例
- const app = getApp();
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- navbarData: { // 由父页面传递的数据
- type: Object,
- value: {},
- callback: ()=> {},
- },
- },
- externalClasses: ['nav-bgc-class', 'nav-title-class'],
- options: {
- multipleSlots: true,
- },
- /**
- * 组件的初始数据
- */
- data: {
- navBarHeight: app.globalData.navBarHeight,
- MenuButtonheight: app.globalData.MenuButtonheight,
- MenuButtonTop: app.globalData.MenuButtonTop,
- },
- /**
- * 组件的方法列表
- */
- methods: {
- _navback() {
- if(this.properties.navbarData.callback) {
- this.properties.navbarData.callback();
- return;
- };
- wx.navigateBack({
- delta: 1
- });
- }
- },
- })
|