index.js 748 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const app = getApp()
  2. Component({
  3. properties: {
  4. // 导航栏标题
  5. name: {
  6. type: String,
  7. value: ''
  8. },
  9. // 是否显示返回按钮
  10. is_back: {
  11. type: Boolean,
  12. value: true
  13. },
  14. // 是否固定导航栏
  15. fixed: {
  16. type: Boolean,
  17. value: false
  18. }
  19. },
  20. data: {
  21. },
  22. lifetimes: {
  23. // 在组件实例进入页面节点树时执行
  24. attached: function() {
  25. this.setData({
  26. menuBtnHeight: app.globalData.menuBtnHeight,
  27. navHeight: app.globalData.navHeight,
  28. navTop: app.globalData.navTop
  29. })
  30. },
  31. // 在组件实例被从页面节点树移除时执行
  32. detached: function() {}
  33. },
  34. methods: {
  35. navBack() {
  36. wx.navigateBack()
  37. }
  38. }
  39. })