我正在玩和测试qooxdo编译器,如何用部件编译?
我有这个,脚本,但是它不工作在窗口或Linux。
Application.js
/*
*
* @use(webApp.EmptyWindow)
*/
qx.Class.define("webApp.Application", {
extend : qx.application.Standalone,
members : {
main : function() {
this.base(arguments);
if (qx.core.Environment.get("qx.debug")) {
qx.log.appender.Native;
qx.log.appender.Console;
}
var button1 = new qx.ui.form.Button("Click me");
var doc = this.getRoot();
doc.add(button1);
button1.addListener("execute", function() {
// this work.!!!
//var emptyWindow = webApp.EmptyWindow.getInstance();
//emptyWindow.open();
// NO WORK.!
var sfile = "webApp.EmptyWindow";
qx.io.PartLoader.require(sfile, function () {
var miWin = qx.Class.getByName(sfile).getInstance();
miWin.open();
});
});
}
}
});EmptyWindow.js
qx.Class.define("webApp.EmptyWindow", {
extend: qx.ui.window.Window,
type: 'singleton',
construct: function () {
this.base(arguments, 'TestOne');
this.set({modal: true});
}
});compile.js
{
"targets": [
{
"type": "source",
"outputPath": "source-output"
},
{
"type": "hybrid",
"outputPath": "hybrid-output"
},
{
"type": "build",
"outputPath": "build-output"
}
],
"defaultTarget": "source",
"locales": ["en"],
"applications": [
{
"class": "webApp.Application",
"theme": "webApp.theme.Theme",
"name": "webApp",
"boot": "source/boot",
"parts": {
"boot": {
"include": [ "webApp.Application", "webApp.theme.Theme" ],
"exclude": []
},
"addClazz": {
"include": [ "webApp.EmptyWindow" ]
}
}
}
],
"libraries": [
"../qooxdoo-master/framework",
"."
]
}错误是:
不明错误:在部件中找不到"webApp.EmptyWindow“(引导,addClazz)
怎么啦?
发布于 2018-01-27 09:54:41
你的角色叫做addClazz而不是webApp.EmptyWindow。换句话说,qx.Part.require想要的是部件的名称,而不是该部件内部的类的名称。
https://stackoverflow.com/questions/48467817
复制相似问题