最近用dojo做了一个选项卡,但是在调用的时候总是显示不出来,但是很奇怪,点击浏览器最大化按钮,或者拖动浏览器改变其大小后,选项卡就会显示出来。
html:
<div data-dojo-type="dijit/layout/TabContainer" style="width: 560px;height:350px;margin: 15px 20px 15px 20px"> <div data-dojo-type="dijit/layout/ContentPane" title="基本设置" > </div> <div data-dojo-type="dijit/layout/ContentPane" title="参数设置" > </div> <div data-dojo-type="dijit/layout/ContentPane" title="阈值设置" > </div> </div>
调用代码:
var _addForm = declare([Widget,TemplatedMixin,WidgetsInTemplateMixin],{...})
后来发现了是调用除了问题:调用里面不应该用Widget,应该用ContentPane
var _addForm = declare([ContentPane,{...})
Widget:"dijit/_WidgetBase"
ContentPane:"dijit/layout/ContentPane"
TemplatedMixin:"dijit/_TemplatedMixin"
WidgetsInTemplateMixin:"dijit/_WidgetsInTemplateMixin"
原文链接:https://www.f2er.com/dojo/290964.html