Last active
August 8, 2016 12:47
-
-
Save philipusis/649e8d80931a84e0f57dfae74b9101c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block('header-menu')( | |
content()(function() { | |
return this.ctx.items.map(function(item) { | |
return { | |
elem: 'menu-item', | |
url: item.url, | |
pseudo: !item.url, | |
mix: [{ block: 'link' }], | |
js: true, | |
attrs: { | |
'data-bem': { 'header-menu__menu-item': { url: item.url } } | |
}, | |
content: item.icon ? | |
[ | |
{ | |
elem: 'menu-item-icon', | |
icon: item.icon | |
}, | |
{ | |
elem: 'menu-item-text', | |
content: item.text | |
} | |
] | |
: item.text | |
} | |
}); | |
}), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment