-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample-1-version-0.0.1.js
More file actions
33 lines (32 loc) · 1.36 KB
/
Copy pathexample-1-version-0.0.1.js
File metadata and controls
33 lines (32 loc) · 1.36 KB
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
new Rex(
Component(function() { // create a function iclude component style!
this.state = {
...this.state, // receive a init virable or static state and this is require to not see any error
click: 0, // can use this click by type in text: '{{$click}}'
};
return View({ // view class
children: [ // children list
Child({ // normal child | static child
// type: '',
// you can select a type but will break a default style
// and if you wanna to use a state virable in innerText or innerHTML on element
// you should insert this virable in <code></code> element or using child function and select a type: code
// and put a virable or text inner it
attrs: { // attrs of html element will be insert
clickValue: "click {{$click}}" // for attr
},
text : 'click {{$click}}', // text | html
events: { // events like {click, mousemove, ...etc}
click: function () {
// onclick do fn
// you can use this.setState function to replace a old value to new one
var newClickValue = this.state.click + 1;
this.setState({
click: newClickValue,
})
}
}
}),
]
});
}));