index.js 906 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // commpents/mobile-frame/index.js
  2. const app = getApp()
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. options: { multipleSlots: true },
  8. properties: {
  9. frameStyle: { type: Object }
  10. },
  11. /**
  12. * 组件的初始数据
  13. */
  14. data: {},
  15. // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
  16. attached: function () { }, // 此处attached的声明会被lifetimes字段中的声明覆盖
  17. ready: function () { },
  18. pageLifetimes: {
  19. // 组件所在页面的生命周期函数
  20. show: function () { },
  21. hide: function () { },
  22. resize: function () { },
  23. },
  24. /**
  25. * 组件的方法列表
  26. */
  27. methods: {
  28. // 返回上一级
  29. back() {
  30. this.triggerEvent('back', '1')
  31. },
  32. tabPath(e) {
  33. this.triggerEvent('tabPath', e)
  34. },
  35. }
  36. })