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

233
Views
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 answers
Answer question

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 Report
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!