added HtmlElement class
This commit is contained in:
parent
bff76688cd
commit
3174f75e21
3 changed files with 36 additions and 0 deletions
5
samples/HelloElement/README.md
Normal file
5
samples/HelloElement/README.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|

|
||||||
|
|
||||||
|
This sample demonstrates the use of the ``HtmlElement`` class.
|
||||||
|
|
||||||
|
Run ``crafter-webbuild serve -c debug`` and go to ``localhost:8080`` to view it.
|
||||||
8
samples/HelloElement/main.cpp
Normal file
8
samples/HelloElement/main.cpp
Normal 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.
|
||||||
|
}
|
||||||
23
samples/HelloElement/project.json
Normal file
23
samples/HelloElement/project.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue