Issue #3292๐Ÿ’ฌ AnsweredOpened Feb 26, 2021by sudiptochoudhury1 reactions

Is there a event per component before save which the component can listen to?

Quick answerby Ju99ernautโค 1

I'm not sure if such hooks exist per component but you can try to take advantage to the toHtml property of a component. It's already been discussed elsewhere so you search it in the issues as there are quite a few.

Read full answer below โ†“

Question

Much grateful to you for this library. Background: I am building an editor where I intend to define most of the components from an existing set of Vuejs components which I have developed earlier and use in my applications. Most of these are UI based simple and complex components. For example, I have simple vuejs components named su-form, su-field, su-label, su-input, su-radios, su-buttons, su-validations and complex vuejs components using the simple components like su-login-form, su-registration-form etc. As you may guess, su-form or su-field and other such components has slots where I add ot...

Answers (3)

Ju99ernautโ€ข Mar 4, 2021

I'm not sure if such hooks exist per component but you can try to take advantage to the toHtml property of a component. It's already been discussed elsewhere so you search it in the issues as there are quite a few.

artfโ€ข Mar 10, 2021

Yeap, you can define your components with a custom toHTML/toJSON function (in model), in order to customize their output

GJSBlockโ€ข May 17, 2026

Thanks for reporting this, @sudiptochoudhury. The issue with Is there a event per component before save which the component can listen to? appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creatin...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins โ†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features โ€” save days of integration work.

Browse premium plugins โ†’

Related tutorials

In-depth guides on the same topic.

All tutorials โ†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.