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

238
Visualizações
GrapeJs package in VueJs Laravel setup, icons onclick events not triggering

This might be something the way js is complied for Vuejs in Laravel but here is the problem.

I have GrapesJs javascript package used like

    <template>
  <div class="base">
    <div id="gjs">
      <h1>Hello World Component!</h1>
    </div>
    <!-- <div id="blocks"></div> -->
  </div>
</template>

<script>
import grapesjs from "grapesjs";
import greapejspreset from "grapesjs-preset-webpage";
export default {
  data() {
    return {
      editor: null,
    };
  },

  mounted() {
    this.editor = grapesjs.init({
      // Indicate where to init the editor. You can also pass an HTMLElement
      container: "#gjs",
      // Get the content for the canvas directly from the element
      // As an alternative we could use: `components: '<h1>Hello World Component!</h1>'`,
      fromElement: true,
      // Size of the editor
      height: "1000px",
      width: "auto",
      // Disable the storage manager for the moment
      storageManager: false,
      // Avoid any default panel
      cssIcons: null,
      plugins: [
        // 'gjs-blocks-basic',


           greapejspreset,
          ],
   this.editor.command("open-blocks");
    });
  },
};
</script>

If I have same example outside the vue file the click on icons works but in this instance when I click any of the icons below it does not trigger anything, its like those events are blocked by vuejs

enter image description here

Please help!!!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Ok after digging this for over 24 hours I am finally able to fix it.

Anyone having any issue like this with GrapeJs please double check that you are not Font awesome js and css, because if you do your spans will be replaced by svgs and onclick are looking for spans.

Another possible issue would be your init for font awesome replacing span with svgs

I figured this out only because I saw svgs and span were hidden in my inspect element

about 4 years ago · Juan Pablo Isaza Relatório
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