Components & JS Question
Question
Hi,
In your Components & JS documentation, it is mentioned that scripts can be added into the "block" section under a script attribute.
However, after some trial and error, whenever the page is saved and reloaded, the script seems to have disappeared.
When I tried to add the script into the "model" section instead, it seems like it becomes permanent. Why is this so?
Answers (2)
Probably you're not storing correctly https://grapesjs.com/docs/modules/Storage.html BTW you can add a script inside blocks but I highly recommend creating a custom component for that case
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #792
Script property using function don't work with blocks
In Components & JS docs there's this example: This works perfectly. But I couldn't use a function instead of a string in script, as is said...
Issue #1559
Issue: broken links in docs
I've found a pair of broken links in docs https://grapesjs.com/docs/modules/Components/ in page https://grapesjs.com/docs/modules/Blocks.ht...
Issue #1030
[Question] Firing events with custom components
I'm trying to build a plugin for Grapesjs with some custom components, and I'm having trouble with triggering events and interacting with t...
Issue #1187
[QUESTION]: why dashed lines do not show around components?
After long time I am trying again with GrapesJS. I am following the Getting Started page and I am stuck to this step https://github.com/art...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.