index.js 847 B

12345678910111213141516171819202122232425262728293031323334353637
  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, value: {} },
  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() {
  31. this.triggerEvent('toClose')
  32. }
  33. }
  34. })