Created
July 26, 2016 07:13
-
-
Save godfreyd/9891ffe4604c908b978101c07976141f to your computer and use it in GitHub Desktop.
This file contains hidden or 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('goods')( | |
tag()('ul'), | |
content()(function() { | |
return this.ctx.goods.map(function(item){ | |
return [ | |
{ | |
elem: 'item', | |
elemMods: { new: item.new && 'yes' }, | |
content: [ | |
{ | |
elem: 'title', | |
content: item.title | |
}, | |
{ | |
elem: 'image', | |
url: item.image | |
}, | |
{ | |
elem: 'price', | |
content: { | |
block: 'link', | |
mix: [ {block: 'goods', elem: 'link'} ], | |
url: item.url, | |
content: item.price | |
} | |
} | |
] | |
}, | |
' ' | |
]; | |
}); | |
}), | |
elem('item')( | |
tag()('li') | |
), | |
elem('title')( | |
tag()('h3') | |
), | |
elem('image')( | |
tag()('img'), | |
attrs()(function() { | |
return { src: this.ctx.url }; | |
}) | |
), | |
elem('price')( | |
tag()('span') | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment