bem-components

by Igor Lilliputten

HTML

<link rel="stylesheet" href="https://yastatic.net/bem-components/latest/desktop/bem-components.css">
<script src="https://yastatic.net/bem-components/latest/desktop/bem-components.js+bemhtml.js"></script>
<body class="page page_theme_islands">
    <div class="b1 i-bem" data-bem="{&quot;b1&quot;:{}}">b1 content</div> 
</body>

JavaScript

modules.define('b1', ['i-bem__dom', 'BEMHTML'], function(provide, BEMDOM, BEMHTML) {
console.log('XXX provide', typeof provide);
alert(typeof provide);

provide(BEMDOM.decl(this.name, {
    onSetMod : {
        js : {
            inited : function() {
                BEMDOM.update(this.domElem, BEMHTML.apply({
                        block : 'radio-group',
                        mods : { theme : 'islands', size : 'm', type : 'line' },
                        name : 'radio-line',
                        options : [
                            { val : 1, text : 'Футбол' },
                            { val : 2, text : 'Баскетбол' },
                            { val : 3, text : 'Гандбол' }
                        ]
                }))
            }
        }
    }
}));

});