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

40 lines
908 B
HTML

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>01 ControlTest</title>
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
</head>
<body>
<script src="../dist/ShadowEditor.UI.js"></script>
<script>
const {
Control,
UI
} = Shadow;
function HelloWorld(options) {
Control.call(this, options);
}
HelloWorld.prototype = Object.create(Control.prototype);
HelloWorld.prototype.constructor = HelloWorld;
HelloWorld.prototype.render = function () {
this.renderDom(this.createElement('div'));
};
UI.addXType('hello', HelloWorld);
let dom = UI.create({
xtype: 'hello',
html: 'Hello, world!'
});
dom.render();
</script>
</body>
</html>