import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add()
/*}}*/
import web.sciter;
var wbSciter = web.sciter(winform)
wbSciter.html = /**
<html>
<head>
<style>
main,main2,main3{
display:block;
}
main {
prototype: Main;
}
main2 {
prototype: Main2;
}
main3 {
prototype: Main3;
}
</style>
<script>
class Main extends Element {
componentDidMount() {
this.render();
}
render() {
this.content("-------------------------- 写在< script >渲染成功 --------------------------");
}
}
</script>
<script type="module">
class Main2 extends Element {
componentDidMount() {
this.render();
}
render() {
this.content(`-------------------------- 写在< script type="module" >没渲染 --------------------------`);
}
}
//globalThis.Main2 = Main2;
//Main2没有被渲染,原因:根据ES定义,在模块中定义的对象是该模块的本地对象。
//如果想从CSS中看到这些对象,它们应该放在全局命名空间中,如下:
</script>
<script type="module">
class Main3 extends Element {
componentDidMount() {
this.render();
}
render() {
this.content(`-------------------------- 写在< script type="module" >因为把类放到了globalThis全局,渲染成功 --------------------------`);
}
}
globalThis.Main3 = Main3;
</script>
</head>
<body>
<main/>
<main2/>
<main3/>
</div>
</body>
</html>
**/
winform.show();
win.loopMessage();