Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
Error "La propiedad 'object3D' no existe en el tipo 'Element'" al intentar acceder a Element.object3D en A-frame con TypeScript

Primero, soy estudiante japonés. Entonces, por favor, perdone mi pobre inglés. Estoy desarrollando una biblioteca de cuadros que hace animaciones con anime.js en TypeScript ahora. Cuando traté de acceder a Element.object3D para actualizar el valor de la posición, TypeScript generó el error "La propiedad 'object3D' no existe en el tipo 'Elemento'". Aquí está mi código.

 function updateValue(target: Element, attr: Attribute, value: number) { switch (attr) { case "PositionX": target.object3D.position.setX(value) case "PositionY": target.object3D.position.setY(value) case "PositionZ": target.object3D.position.setZ(value) }

Me doy cuenta de que 'object3D' no existe en Element, pero cuando importa un marco, existe. Traté de require("aframe") pero este problema no se solucionó. Me disculpo por la naturaleza rudimentaria de esta pregunta y mi pobre inglés, pero estaría muy agradecido si pudiera responderla.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Probablemente necesite instalar el paquete @types/aframe , para tener las escrituras para su proyecto mecanografiado.

Después de eso, use Entity o Scene (no sé cuál es el que recibe en updateValue pero esos 2 contienen object3D .

 function updateValue(target: Entity, attr: Attribute, value: number) {
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!