Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
How to create class to overwritte JSON blueprint JS

I create jsonBlueprint to looks like :

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

So i can get that values pretty easy by freeT.TextFontColo etc.. How can i create Json function to set that values ?

I have something like that

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;
}

I want these values(from createJson class) ​​refer to individual elements in blueprint and overwrite them. Actually in my finally Json i have bluePrint where i can see :

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

I want it to looks like :

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

and this values(fontsize,textcolor) should be overwrite by createJson function.

I tryied to change input.name to be like : header.FontSize but its just create :

- header: 
       FontSize: "2.5vw",
       TextColor: "#000000",
-header.Fontsize:"2.5vw",
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda