added HtmlElement class

This commit is contained in:
Jorijn van der Graaf 2025-02-12 23:05:59 +01:00
commit 3174f75e21
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,5 @@
![alt text](https://github.com/Catcrafts/Crafter.Web/blob/master/samples/HelloWorld/HelloWorld.png?raw=true)
This sample demonstrates the use of the ``HtmlElement`` class.
Run ``crafter-webbuild serve -c debug`` and go to ``localhost:8080`` to view it.

View file

@ -0,0 +1,8 @@
import Crafter.CppDOM;
using namespace Crafter::CppDOM;
int main(){
HtmlElement body("body");
body.SetInnerHTML("Hello World!");
//No need to call FreeJs, this is done in the destructor of HtmlElement.
}

View file

@ -0,0 +1,23 @@
{
"name": "hello-element",
"configurations": [
{
"name": "debug",
"standard": "c++26",
"source_files": ["main"],
"module_files": [],
"additional_files": [],
"build_dir": "./build",
"output_dir": "./bin",
"optimization_level": "0",
"target": "wasm32-unknown-wasi",
"type": "executable",
"dependencies": [
{
"path":"../../project.json",
"configuration":"debug"
}
]
}
]
}