bem-components
bem-components copied to clipboard
Add setText method to link component
Really need it.
link.domElem.text('text');
@voischev I thought so too. But for example menu__item
used getText()
method https://github.com/bem/bem-components/blob/v5/common.blocks/menu/__item/menu__item.js#L70
/**
* Returns item text
* @returns {String}
*/
getText : function() {
return this.params.text || this.domElem.text();
},
I think it's a good practice to use the same style API (get
, set
) in the library