Answer the question
In order to leave comments, you need to log in
What about JS and prefixes in BEM (BEM)?
I saw somewhere that there are some prefixes for classes like js-classname, but in the office. I did not find such documentation.
so what to prescribe to elements, prefixes to classes or id? to refer to them in js
Answer the question
In order to leave comments, you need to log in
From the history of BEM development https://ru.bem.info/methodology/history/
real
Example: https://codepen.io/ilyar/pen/WZzzmP?editors=1010#0
<div class="myBlock i-bem" data-bem='{"myBlock":{"param": "val"}}'>
...
</div>
modules.define('myBlock', ['i-bem-dom'], function (provide, bemDom) {
provide(bemDom.declBlock(this.name, /* методы экземпляра */ {
onSetMod: {
'js': {
'inited': function () {
this.domElem[0].innerHTML = this.__self.parseParams(this.params);
}
}
}
}, /* статические методы */ {
parseParams: function (params) {
return '<pre>' + JSON.stringify(params, null, ' ') + '</pre>';
}
}
));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question