index.js 685 B

1234567891011121314151617181920212223242526272829303132333435
  1. const app = getApp()
  2. Component({
  3. properties: {
  4. navbarData: { //navbarData 由父页面传递的数据
  5. type: Object,
  6. value: {},
  7. height: app.globalData.height
  8. },
  9. needBack: { type: Boolean, value: true }
  10. },
  11. data: {
  12. height: '',
  13. //默认值 默认显示左上角
  14. navbarData: {
  15. }
  16. },
  17. attached: function () {
  18. // 定义导航栏的高度 方便对齐
  19. this.setData({
  20. height: app.globalData.height
  21. })
  22. },
  23. created() {
  24. this.setData({
  25. height: app.globalData.height
  26. })
  27. },
  28. methods: {
  29. // 返回上一页面
  30. _navback() {
  31. // wx.navigateBack()
  32. this.triggerEvent('back',)
  33. }
  34. }
  35. })