// components/navBar/navBar.ts
Component({
  /**
   * 组件的属性列表
   */
  options: {
    multipleSlots: true,
    styleIsolation: 'apply-shared'
  },

  properties: {
    bg: {
      type: String,
      value: ''
    },
    filled: {
      type: Boolean,
      value: true
    },
    type: {
      type: String,
      value: 'white'
    },
    back: {
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    menuInfo: wx.getStorageSync('MenuButtonBoundingClientRect'),
    padding: 8,
    pageNum: 0
  },

  lifetimes: {
    ready() {
      console.log('getCurrentPages().length',getCurrentPages().length);
      
      this.setData({
        pageNum: getCurrentPages().length
      })
      
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleBack() {
      wx.navigateBack({
        delta: 1
      })
    },
  }
})
