index.js 878 B

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