index.js 706 B

123456789101112131415161718192021222324252627282930
  1. Component({
  2. behaviors: [require('../common/share-behavior').default],
  3. properties: {
  4. a: Number,
  5. },
  6. data: {
  7. loaded: false
  8. },
  9. lifetimes: {
  10. attached() {
  11. console.log('data.a', this.data.a) // expected 123
  12. }
  13. },
  14. methods: {
  15. handleReady: function({detail}) {
  16. this.scene = detail.value;
  17. console.log('scene', detail.value);
  18. },
  19. handleAssetsProgress: function({detail}) {
  20. console.log('assets progress', detail.value);
  21. },
  22. handleAssetsLoaded: function({detail}) {
  23. console.log('assets loaded', detail.value);
  24. this.setData({loaded: true});
  25. },
  26. handleRaf: function({detail}) {
  27. console.log('raf', detail.value);
  28. }
  29. }
  30. })