index.js 603 B

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