Commit fd3d5ff7 authored by Yuri Bondarenko's avatar Yuri Bondarenko

1

parent 8f88440b
/**
* Базовый компонент
*/
export default class Component {
/**
* Конструктор
*/
constructor( props = {} ){
/**
* Параметры компонента:
* scopeSelector - корневой селектор
* selectors - селекторы перерисовываемых данных
*/
this.props = {
scopeSelector: '',
selectors: []
};
// объединяем с переданными параметрами
Object.assign( this.props, props );
// дефолтное состояние
this.state = {};
// отрисовываем
this.render();
}
/**
* Установка состояния
*/
setState( state = {} ){
Object.assign( this.state, state );
this.render();
}
/**
* обновляем компонент
*/
render(){
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment