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

201
Views
Cómo crear una clase para sobrescribir JSON blueprint JS

Creo jsonBlueprint para que se parezca a:

 const jsonBlueprint = { "header": { "FontSize": "2.5vw", "TextColor": "#000000", }, "freeT":{ "TextFontColor": "#000000", "TextFontSize": "2vw" }

Entonces puedo obtener esos valores bastante fácilmente con freeT.TextFontColo, etc. ¿Cómo puedo crear la función Json para establecer esos valores?

tengo algo asi

 function createJsonFile(template) { const Json = {}; const inputs = [...template.querySelectorAll('.formInput')]; inputs.map(input => { if (input.type != 'toggle') { Json[input.name] = input.value; } else { Json[input.name] = input.checked; } }); return Json; }

Quiero que estos valores (de la clase createJson) se refieran a elementos individuales en blueprint y los sobrescriban. En realidad, en mi finalmente Json tengo bluePrint donde puedo ver:

 - header: FontSize: "2.5vw", TextColor: "#000000", - FontSize:"2.5vw" - TextColor:"#000000"

Quiero que se vea como:

 - header: FontSize: "2.5vw", TextColor: "#000000"

y estos valores (tamaño de fuente, color de texto) deben sobrescribirse con la función createJson.

Intenté cambiar input.name para que sea como: header.FontSize pero es solo crear:

 - header: FontSize: "2.5vw", TextColor: "#000000", -header.Fontsize:"2.5vw",
about 4 years ago · Juan Pablo Isaza
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!