Open kaimou1357 opened 9 months ago
I have a generated JSX component with HTML code
VvvebJs does not use React and JSX it can only work with plain html.
Got it. If we render the plain HTML from the components themselves, how can we load it into VVEBJS to act as a drag and drop editor?
You can load html code with setHtml
Vvveb.Builder.setHtml("<h1>Hello world!</h1>");
To start with a blank page and set the html at startup
Vvveb.Builder.init("about:blank", function() {
//load code after page is loaded here
Vvveb.Builder.setHtml("<h1>Hello world!</h1>");
});
You can replace "about:blank"
with a custom empty html file something like "blank.html"
to add proper <head><body>
tags.
The easiest way is to load the html page directly
Vvveb.Builder.init("my-page.html", function() {
//run code after page is loaded here
});
My current use case here is that I'd actually like to use VvebJs to act as an editable HTML canvas.
For example - I have a generated JSX component with HTML code. I'd basically like VvebJs to provide a Javascript Canvas where the user can select something, make edits, or comment on it. Would VvebJS be able to provide the entire markdown + the selected component? If so - would you be able to direct me to the feature set/APIS needed?
I actually do NOT need the other features like the sidebar etc. I just want to edit pure JSX code.