ShadowEditor/ShadowEditor.UI/test/07 ButtonTest.html
2018-11-11 21:50:07 +08:00

52 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>07 ButtonTest</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
.red {
color: red;
}
</style>
</head>
<body>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
const {
Control,
UI
} = Shadow;
var control = UI.create({
xtype: 'div',
children: [{
xtype: 'button',
attr: {
id: 'button1',
title: 'This is button 1.',
},
cls: 'red',
html: 'Button 1',
listeners: {
click: function () {
alert('You clicked button 1.');
}
}
}, {
xtype: 'button',
style: {
color: 'green'
},
html: 'Button 2'
}]
});
control.render();
</script>
</body>
</html>