HM-27 Добавил компонет меню вместе с компонентом кнопки (#11)
* HM-27 Добавил компонет меню вместе с компонентом кнопки
This commit is contained in:
15
src/components/button-component/ButtonComponent.js
Normal file
15
src/components/button-component/ButtonComponent.js
Normal file
@ -0,0 +1,15 @@
|
||||
import Component from '../component/index';
|
||||
|
||||
class ButtonComponent extends Component {
|
||||
constructor (parentNode, text, newStyle) {
|
||||
super('#button', parentNode);
|
||||
|
||||
this.mainNode.textContent = text;
|
||||
this.mainNode.className = newStyle;
|
||||
|
||||
this.addEventListener(this.mainNode, 'click', (event) => {
|
||||
this.next('click', event);
|
||||
});
|
||||
}
|
||||
}
|
||||
export default ButtonComponent;
|
||||
0
src/components/button-component/index.js
Normal file
0
src/components/button-component/index.js
Normal file
Reference in New Issue
Block a user