index.js 736 B

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