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

239
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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