首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >qooxdoo qooxdoo编译器如何使用部件

qooxdoo qooxdoo编译器如何使用部件
EN

Stack Overflow用户
提问于 2018-01-26 18:55:20
回答 1查看 160关注 0票数 0

我正在玩和测试qooxdo编译器,如何用部件编译?

我有这个,脚本,但是它不工作在窗口或Linux。

Application.js

代码语言:javascript
复制
/*
*
* @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

代码语言:javascript
复制
qx.Class.define("webApp.EmptyWindow", {
    extend: qx.ui.window.Window,
    type: 'singleton',
    construct: function () {
        this.base(arguments, 'TestOne');

        this.set({modal: true});
    }
});

compile.js

代码语言:javascript
复制
{
  "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)

怎么啦?

EN

回答 1

Stack Overflow用户

发布于 2018-01-27 09:54:41

你的角色叫做addClazz而不是webApp.EmptyWindow。换句话说,qx.Part.require想要的是部件的名称,而不是该部件内部的类的名称。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48467817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档