index.js 957 B

12345678910111213141516171819202122232425262728293031323334353637
  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({detail}) {
  16. const xrScene = this.scene = detail.value;
  17. console.log('xr-scene', xrScene);
  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. handleARReady: function({detail}) {
  27. console.log('ar-ready', this.scene.ar.arModes, this.scene.ar.arVersion);
  28. },
  29. handleARError: function({detail}) {
  30. console.log('ar-error', detail);
  31. },
  32. handleLog: function({detail}) {
  33. const {el, value} = detail;
  34. console.log('log', detail.value);
  35. },
  36. }
  37. })