gpt4 book ai didi

javascript - qooxdoo qooxdoo-compiler 如何使用部件

转载 作者:行者123 更新时间:2023-12-03 02:37:59 27 4
gpt4 key购买 nike

我正在玩并测试qooxdo-compiler,如何进行部分编译?

我有这个脚本,但它在 Window 或 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});
}
});

编译.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",
"."
]
}

错误是:

Uncaught Error: Part "webApp.EmptyWindow" not found in parts (boot, addClazz)

出了什么问题?

最佳答案

您的部分称为 addClazz 而不是 webApp.EmptyWindow。换句话说,qx.Part.require想要零件的名称,而不是相关零件中的类的名称。

关于javascript - qooxdoo qooxdoo-compiler 如何使用部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48467817/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com