Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda