gpt4 book ai didi

dojo - 自定义 Dojo 构建的问题实习字符串

转载 作者:行者123 更新时间:2023-12-04 21:56:49 28 4
gpt4 key购买 nike

试图找出为什么我似乎无法在我的 dojo 构建中实习字符串。我的图层文件已正确创建,但与每个单独的 dijit 关联的代码未正确嵌入。

这是构建输出的一部分,说明了失败的地方:

release:  Interning strings for : ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/commenting.js
release: ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/templates/commenting.htm
release: Optimizing (shrinksafe, stripConsole=normal) file: ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/commenting.js
release: Could not strip comments for file: ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/commenting.js,

error: InternalError: illegal character

看起来优化失败了,因为模板没有正确添加到 js 文件中。这是 html 被实习后 js 的样子。您无法从输出中分辨出来,但是在 javascript 的末尾添加了一些特殊字符。

if(!dojo._hasResource["fwijits.optionalDijits.commenting"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["fwijits.optionalDijits.commenting"] = true;
dojo.provide("fwijits.optionalDijits.commenting");

dojo.require("dijit._Widget");
dojo.require("dijit._Templated");

dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");


//The main widget that gets returned to the browser
dojo.declare("fwijits.optionalDijits.commenting", [dijit.layout.ContentPane, dijit._Templated], {

widgetsInTemplate: true,
_earlyTemplatedStartup: true,
templateString: dojo.cache("fwijits.optionalDijits", "templates/commenting.htm"),
basePath: dojo.moduleUrl("fwijits.optionalDijits"),

//This function contains all configurable parameters
constructor: function(params){
params = params ||{};
this.inherited(arguments);
},

//This functions run on a "startup" call
startup: function(){
var _this = this;

this.inherited(arguments);
},

_addPointComment:function(){
console.debug("button clicked");
}

});

}

htm 文件非常简单,所以我认为这不是问题的根源。

<div dojoAttachPoint="containerNode">
<div dojoattachpoint="_outerDiv">
<div dojoattachpoint="_addPoint" dojotype="dijit.form.Button" dojoattachevent="onClick:_addPointComment"><b>Add Comment</b></div>
</div>
</div>

有什么建议吗?

最佳答案

哪个版本的 Dojo?构建系统中存在一个错误,其驻留字符串不以 HTML 或 HTM 结尾,尽管我从未尝试使用 HTM 来确定这一点。

可能值得一试。我知道这已在 1.7 中修复并向后移植到 1.8。

https://bugs.dojotoolkit.org/ticket/15867

关于dojo - 自定义 Dojo 构建的问题实习字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10853861/

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