gpt4 book ai didi

dojo - 迪 git : Why am I getting an "Uncaught Error: Invalid Template"?

转载 作者:行者123 更新时间:2023-12-04 23:05:18 26 4
gpt4 key购买 nike

据我所知,我有一个看起来不错的 dijit,但它正在提高 Uncaught Error: Invalid template每次。我一直无法弄清楚为什么。所有变量(例如 ${variableName} 都在小部件中正确定义。

这是小部件:

<div class="${classPrefix}-wrapper">
<div class="${classPrefix} flair" dojoAttachPoint="flairNode"></div>
<div class="${classPrefix}-count hidden" dojoAttachPoint="countWrapperNode">
<div class="count" dojoAttachPoint="countNode">0</div>
</div>
<div class="${classPrefix} ${secondaryClass} action hidden" dojoAttachPoint="secondaryClickNode" dojoAttachEvent="onclick:_onSecondaryClick">
<div class="${classPrefix}-inner"></div>
<div class="${classPrefix}-icon"></div>
</div>
<div class="${classPrefix} ${primaryClass} action" dojoAttachPoint="primaryClickNode" dojoAttachEvent="onclick:_onPrimaryClick">
<div class="${classPrefix}-inner"></div>
<div class="${classPrefix}-icon"></div>
</div>
<div class="${classPrefix}-message hidden" dojoAttachPoint="messageNode"></div>
</div>
<div class="${actionPromptNodeClass}" dojoAttachPoint="actionPromptMessageNode">
<span dojoAttachPoint="actionPromptMessage">${actionPromptText}</span>
<span dojoAttachPoint="actionCompletedMessage" class="hidden">${actionCompletedText</span>
</div>

最佳答案

找到了我的问题的答案。事实证明,Dijit 中只能有一个根节点。我在文档中错过了这个,but it is at the bottom of this tutorial :

Common Pitfalls

  • Be sure to only have one root node in your template
  • Don’t start or end your template with a comment because that means you technically have two nodes
  • Avoid a trailing </div> at the end of your template

关于dojo - 迪 git : Why am I getting an "Uncaught Error: Invalid Template"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13883902/

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