R
R
RaDir2017-07-20 12:00:23
BEM
RaDir, 2017-07-20 12:00:23

How to correctly override components from bem-components?

Hello!
Dealing with bem-components (ready assembly project-stub), I "stumbled" on the redefinition of ready-made components bem-components 6.0.0. And more specifically, on the link component/block.
I add to index.bemjson.js:

...
elem: 'logo',
                                    mix: { block: 'grid', elem: 'cell' },
                                    content:
                                        {
                                            block: 'link',
                                            url: 'http://test.ru',
                                            content: 'link text'
                                        }
...

At the exit:
<a class="link link__control i-bem" data-bem='{"link":{}}' role="link" href="http://test.ru">link test</a>

By adding the link js: false block to index.bemjson.js . Gives no results.
I tried to make the modifier of the link link_nojs.bemhtml.js block in test mode, js implementation turned off "js () (false)". But I don’t know how to remove from the template, for example, the link_control mix.
Dear Bem-experts, please tell me how to correctly redefine mixes, js, elements, modifiers!
I just kindly ask you not to send BEM.info to the documentation, because I have already spent many hours there, but I have not received an answer to my question.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RaDir, 2017-07-20
@RaDir

In general, I solved the problem as follows. Maybe someone will come in handy.
Overridden link.bemhtml.js:

block('link')(
    js()(false),

    mix()(function() {
        var mix = this.ctx.mix;
        return mix;
    })
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question