2016-11-30 57 views
0

我试图给existing jsfiddle的jsfiddle使用Dojo不要捡风格,原因不明

require([ 
"dojo/dom", 
"dijit/Dialog", 
"dijit/form/Button", 
"dijit/layout/BorderContainer", 
"dijit/layout/ContentPane", 
"dojo/domReady!" 
], function(dom, DijitDialog, Button, BorderContainer, ContentPane) { 

(new Button({ 
    label: 'Show dialog', 
    onClick: function() { 


     var layout = new BorderContainer({ 
      design: "headline", 
      style: "width: 400px; height: 400px; background-color: yellow;" 
     }); 

     var centerPane = new ContentPane({ 
      region: "center", 
      style: "background-color: green;", 
      content: "center"       
     }); 

     var actionPane = new ContentPane({ 
      region: "bottom", 
      style: "background-color: blue;" 
     }); 

     (new Button({ label: "OK"})).placeAt(actionPane.containerNode); 
     (new Button({ label: "Cancel"})).placeAt(actionPane.containerNode); 

     layout.addChild(centerPane); 
     layout.addChild(actionPane); 
     layout.startup(); 

     var dialog = new DijitDialog({ 
      title: 'dialog title', 
      style: { 
       //width: '400px', 
       //height: '400px', 
      }, 
      content: layout 
     }); 

     dialog.containerNode.style.backgroundColor = "red"; 
     dialog.startup(); 
     dialog.show(); 

    } 

})).placeAt(document.body); 

复制到new jsfiddle

require([ 

。 。 。 })

它使用更新版本的dojo但EXACT相同的代码。我已经为框架设置中使用的适当版本的dojo添加了外部资源“claro.css”,并且在JavaScript设置中添加了相同的LOAD TYPE,但是我的小提琴显然缺少样式,因为它不是呈现像原文:对话框和BorderContainer缺少边框,背景色和基本上所有样式。

因为在我正在处理的应用程序中发生同样的事情(样式未被应用)到对话框dijit,所以这更加重要。

我在小提琴中失去了什么?

回答

0

你错过了克拉罗的身体标记。点击HTML上的设置图标,并将其添加到正文标签。

<body class="claro"> 

enter image description here

+0

也做到了,谢谢! – user2193215

+0

如果解决了您的问题,请将其选为答案。 – Aslam

+0

我如何选择它作为答案?没有看到这样做的链接。 – user2193215