Dojo TabContainer 示例不起作用
Dojo TabContainer example not working
我一直在尝试 运行 来自 https://dojotoolkit.org/reference-guide/1.10/dijit/layout/TabContainer.html 的示例,但我没有得到任何标签。这是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.11.2/dijit/themes/claro/claro.css" />
<!-- load Dojo -->
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js"></script>
<div style="width: 350px; height: 290px">
<div id="tc1-prog"></div>
</div>
<script>
require(["dijit/layout/TabContainer", "dijit/layout/ContentPane", "dojo/domReady!"], function(TabContainer, ContentPane) {
var tc = new TabContainer({
style : "height: 100%; width: 100%;"
}, "tc1-prog");
var cp1 = new ContentPane({
title : "Food",
content : "We offer amazing food"
});
tc.addChild(cp1);
var cp2 = new ContentPane({
title : "Drinks",
content : "We are known for our drinks."
});
tc.addChild(cp2);
tc.startup();
});
</script>
</body>
</html>
我是不是漏掉了什么?谢谢
你只需要在正文标签中添加class="claro"。之前已经回答过:Dojo TabContainer not styling
我一直在尝试 运行 来自 https://dojotoolkit.org/reference-guide/1.10/dijit/layout/TabContainer.html 的示例,但我没有得到任何标签。这是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.11.2/dijit/themes/claro/claro.css" />
<!-- load Dojo -->
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.11.2/dojo/dojo.js"></script>
<div style="width: 350px; height: 290px">
<div id="tc1-prog"></div>
</div>
<script>
require(["dijit/layout/TabContainer", "dijit/layout/ContentPane", "dojo/domReady!"], function(TabContainer, ContentPane) {
var tc = new TabContainer({
style : "height: 100%; width: 100%;"
}, "tc1-prog");
var cp1 = new ContentPane({
title : "Food",
content : "We offer amazing food"
});
tc.addChild(cp1);
var cp2 = new ContentPane({
title : "Drinks",
content : "We are known for our drinks."
});
tc.addChild(cp2);
tc.startup();
});
</script>
</body>
</html>
我是不是漏掉了什么?谢谢
你只需要在正文标签中添加class="claro"。之前已经回答过:Dojo TabContainer not styling