-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to achieve a bemhtml replace() like behaviour? #173
Comments
Guess, like this: bh.match('tabbar', function(ctx, json) {
return {
block: 'tabs-menu',
mix: bh.extend(ctx.mix(), [{
block: 'tabbar',
mods: bh.extend(ctx.mods(), {'show-extra': 'no'}),
js: true
}])
};
}); |
Сатанинский шаблон. bh.match('tabbar', function(ctx) {
ctx.js(true);
ctx.mod('show-extra', 'no');
return {
block: 'tabs-menu',
mix: [].concat(ctx.json(), ctx.mix())
};
}); |
Простите, что врываюсь в тред. Но шаблон на bem-xjst тоже какой-то сатанинский. @a-x- какую задачу ты хочешь решить? Кроме того, у меня сложилось впечатление, что:
Итого должно получится как-то так: {
block: 'tabbar',
mods: { m: 'v' },
mix: { block: 'mixed' }
} block('tabbar')(
def()(function() {
this.mods['show-extra'] = 'no';
return applyNext();
}),
js()(true),
mix()('tabs-menu')
) <div class="tabbar tabbar_m_v tabbar_show-extra_no tabs-menu mixed i-bem" data-bem='{"tabbar":{}}'></div> Можно покрутить повертеть в Online demo: https://goo.gl/SmDSTa |
@a-x- прочитай, пожалуйста, еще раз про то, что доступно в теле шаблона.
|
@miripiruni Кажется, логично ожидать доступным this.mix который будет всегда массивом. |
а если я примиксую tabs-menu то его шаблоны же не применятся, а они нужны, т.к. я делаю наследование |
хочу |
The text was updated successfully, but these errors were encountered: