Я только начал заниматься додзё. Ниже приведен код.
Код для отображения трех кнопок, взятый из примера, показанного на сайте додзё.
<html lang = "en">
<head>
<meta charset = "UTF-8">
<meta name = "viewport" content = "width=device-width, initial-scale=1.0">
<meta http-equiv = "X-UA-Compatible" content = "ie=edge">
<title>First | dojo</title>
</head>
<body>
<script>
var dojoConfig = {
async: true
};
</script>
<script src = "//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>
<script>
require([
'dojo/dom',
'dojo/on',
'dojo/parser',
'dijit/registry',
'dijit/form/Button',
'dojo/domReady'
], function (dom, on, parser, registry) {
var myClick = function(evt) {
console.info("I was clicked");
};
parser.parse();
on(dom.byId("button1"), "click", myClick);
on(registry.byId("button2"), "click", myClick);
});
</script>
<h1 id = "greeting">Namastey</h1>
<div>
<button id = "button1" type = "button">Button1</button>
<button id = "button2" data-dojo-type = "dijit/form/Button" type = "button">Button2</button>
<button id = "button3" data-dojo-type = "dijit/form/Button" type = "button">
<div>Button3</div>
<script type = "dojo/on" data-dojo-event = "click">
console.info("I was clicked");
</script>
</button>
</div>
</body>
</html>
Результат рендеринга
Может кто-нибудь объяснить, что не так. Я пробовал искать в гугле, но ничего не нашел.
Кроме того, я не вижу ошибок или предупреждений в консоли.
Чтобы просто забыть импортировать файл css темы, а также добавить класс имени темы в тег body,
поэтому добавьте:
<link href = "http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dijit/themes/claro/claro.css" rel = "stylesheet" />
<body class = "claro">
см. ниже рабочий фрагмент:
узнать больше о тематике додзё здесь
require([
'dojo/dom',
'dojo/on',
'dojo/parser',
'dijit/registry',
'dijit/form/Button',
'dojo/domReady'
], function (dom, on, parser, registry) {
var myClick = function(evt) {
console.info("I was clicked");
};
parser.parse();
on(dom.byId("button1"), "click", myClick);
on(registry.byId("button2"), "click", myClick);
});
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
#accContainer {
height: 100% !important;
}
<script src = "//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>
<link href = "http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dijit/themes/claro/claro.css" rel = "stylesheet" />
<script>
dojoConfig = {
parseOnLoad: true,
async: true
};
</script>
<script src = "//ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js"></script>
<body class = "claro">
<h1 id = "greeting">Namastey</h1>
<div>
<button id = "button1" type = "button">Button1</button>
<button id = "button2" data-dojo-type = "dijit/form/Button" type = "button">Button2</button>
<button id = "button3" data-dojo-type = "dijit/form/Button" type = "button">
<div>Button3</div>
<script type = "dojo/on" data-dojo-event = "click">
console.info("I was clicked");
</script>
</button>
</div>
</body>
нет, есть библиотека, которая реализует boostrap, вот URL, github.com/atoha/dbootstrap
Означает ли это, что я не могу использовать бутстрап с додзё, если захочу?