Issue #2703✓ SolvedOpened Apr 5, 2020by adamwpe3 reactions

Make the whole canvas a Vue / React element

Quick answerby adamwpe2

Thanks @noogen for your detailed reply. Yh, think you are right and stick with components - I'm not too sure if the ToHtml if the right solution is for me or not, because I don't want to manage two types of system, on rending correctly within the editor, and one in production, using the tags. So, I'm now loading in a...

Read full answer below ↓

Question

Hi All, More of a general question of if anyone has managed to make the whole canvas (or in fact the wrapper) a Vue element, meaning that you could drag some a custom div like '<timer></timer>' and it renders correctly? I've attempted this, I made the wrapper the vue element (el), and it did work when 'importing' HTML code, but it prevents the drag and drop system from working, I presume because now it's a virtual DOM. I did see this post: https://github.com/artf/grapesjs/issues/275 but it went down the component route, of adding scripts to DomComponents. Has anyone managed this? Or even in R...

Answers (2)

👍 Most helpfuladamwpeApr 7, 2020

Thanks @noogen for your detailed reply. Yh, think you are right and stick with components - I'm not too sure if the ToHtml if the right solution is for me or not, because I don't want to manage two types of system, on rending correctly within the editor, and one in production, using the tags. So, I...

noogenApr 5, 2020

My answer is to best stick with custom scripts. I've done custom components using lodash template here: https://github.com/niiknow/grapesjs-components-farmer/blob/master/src/index.js#L2. A string is expected from thetoHtml method - https://github.com/niiknow/grapesjs-components-farmer/blob/master/s...

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.