-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbox_sizing.js
More file actions
51 lines (45 loc) · 903 Bytes
/
Copy pathbox_sizing.js
File metadata and controls
51 lines (45 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"use strict";
"use math";
class __ComponentState__ extends Object {
renderFn;
props;
children;
constructor(builder, props, children) {
super();
this.renderFn = builder;
this.props = props;
this.children = children;
}
update() {
// this.scene.updateComponent(this);
}
render() {
return this.renderFn(this.props, this.children);
}
};
function JSX(tag, atts, kids) {
if (typeof tag == 'function') {
return new __ComponentState__(tag, atts, kids);
} else {
return {
tag,
atts,
kids,
};
}
}
var simple_css = `
body {
margin: 8px;
}
.button {
display: inline-block;
border: 1px solid black;
padding: 4px;
width: 80px;
height: 40px;
box-sizing:border-box;
}
`;
var two_button = (<body><div class="button">最小化</div><div class="button" style="box-sizing:content-box;">最小化</div></body>);
app.showDialog(two_button, simple_css);