有时我真的想知道我不只是使用 jQuery ......
基本模板化 Dijit:
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
'dojo/text!./templates/basic.html'
],
function(
declare,
_WidgetBase,
_TemplatedMixin,
_WidgetsInTemplate,
template
) {
return declare("Slider", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplate], {
templateString : template
})
})
模板:
<div class="${baseClass}">
<div data-role="decor" data-dojo-type="gs/ImageBox/ImageBox">
<header>
<h2>Air Jordan 6</h2>
<h6>2000</h6>
</header>
<footer>
<a href="javascript:void(0);" data-role="toggle">More Information</a>
</footer>
</div>
<div data-role="content">
<section class="data">
<header>
<a href="javascript:void(0);" data-role="toggle" class="sticky">Hide</a>
<ul class="list_info">
<li><span>Release Date</span><span>3.15.2003</span></li>
<li><span>Release Type</span><span>General Release</span></li>
<li><span>Cost at release</span> <span>$100</span></li>
<li><span>Cost Today</span> <span>$325-$600</span></li>
</ul>
</header>
<!--
<div data-dojo-type="dijit/layout/ContentPane" href="./php/info.php?id=3"></div>
-->
</section>
</div>
</div>
引发通用解析错误。如果我删除data-dojo-type="gs/ImageBox/ImageBox"
声明,它至少会解析。
道场配置:
<script>
dojoConfig = {
parseOnLoad : false,
async : true,
cacheBust : true,
packages : [
{ name : 'gs', location: location.pathname.replace(/\/[^/]*$/, '/js') }
],
debug : true,
debugAtAllCosts : true
}
</script>
如果 Dojo 抛出包含一些信息的错误,那就太棒了,但它只是给出了parse error()
dojo.js 的第 22 行。
快把我逼疯了。