Skip to content

Commit ecb47b0

Browse files
authored
Update README.md
1 parent 2effa34 commit ecb47b0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,37 @@ Include HTML tag (e.g. ```<my-button id='button'></my-button>)``` in any time of
3333
You also take advantage of features like lazy-loading, that allows for loading components on demand, only when user add them to document
3434

3535
## Introduction
36+
3637
A basic element definition looks like this:
3738

39+
```javascript
40+
JQX('smart-test', class TestElement extends Smart.BaseElement {
41+
// properties.
42+
static get properties() {
43+
return {
44+
'content': {
45+
type: 'string'
46+
}
47+
};
48+
}
49+
50+
/** Element's template. */
51+
template() {
52+
return '<div inner-h-t-m-l=\'[[innerHTML]]\'></div>';
53+
}
54+
55+
ready() {
56+
super.ready();
57+
}
58+
59+
propertyChangedHandler(propertyName, oldValue, newValue) {
60+
super.propertyChangedHandler(propertyName, oldValue, newValue);
61+
}
62+
});
63+
```
64+
65+
An extended element definition looks like this:
66+
3867
```javascript
3968
Smart('smart-button', class Button extends Smart.ContentElement {
4069
// Button's properties.

0 commit comments

Comments
 (0)