import win.ui; import init; // 初始化 init.init(); var gConfig = init.loadConfigs(); var gDebug = init.getDebug(); /*DSG{{*/ mainForm = win.form(text="awin";right=gConfig.window.width;bottom=gConfig.window.height;border="thin";max=false;min=false) mainForm.add() /*}}*/ // 启动界面 var gLog = init.getLog(); gLog.print("web view") import web.view; var theView = web.view(mainForm); //导出为 JavaScript 中的 aardio 对象 theView.external = { onCounterUpdate = function(name,value){ if(name!==null && value!==null){ return "aardio 返回的值:网页中 React 状态值改变了:value:"+value; } }; } import wsock.tcp.simpleHttpServer; /* 如果导入 simpleHttpServer,则单个斜杠开头的路径会转换为嵌入式 HTTP 地址, 如果同时文件名为 index.html ,则上级目录自动设为根目录,前端应用发布根目录使用默认的 "/" 即可,不需要改动。 去掉下面的前端项目调试端口号 37151 或发布 EXE 后运行才会打开 "\web\index.html"。 否则打开 http://localhost:37151 */ if( gDebug ){ theView.go("\web\index.html",37151); } else { theView.go("\web\index.html"); } mainForm.show(); win.loopMessage();