Advertisement
repente

Untitled

Dec 4th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class TableComponent {
  2. constructor(anchor, props){
  3. this.anchor = anchor;
  4. this._props = props;
  5. }
  6.  
  7. onInit() {}
  8.  
  9. onPropsChanges() {
  10. this.anchor.innerHTML = this.render();
  11. }
  12.  
  13. render() {
  14.  
  15. return `
  16. <table>
  17. <tr>
  18. <td></td>
  19. </tr>
  20. </table>
  21. `;
  22. }
  23.  
  24. set props(value) {
  25. this._props = value;
  26. this.onPropsChanges(this._props);
  27. }
  28.  
  29. get props() {
  30. return this._props;
  31. }
  32. }
  33.  
  34. function module(){
  35. return {
  36. TableComponent: TableComponent,
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement