mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
40 lines
908 B
HTML
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> |