Created
November 30, 2012 17:00
-
-
Save varya/4176996 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 goods { | |
tag: 'ul' | |
content: { | |
var content = []; | |
this.ctx.goods.forEach(function(item){ | |
content.push({ | |
elem: 'item', | |
content: [ | |
{ | |
elem: 'title', | |
content: item.title | |
}, | |
{ | |
elem: 'image', | |
url: item.image | |
}, | |
{ | |
elem: 'price', | |
content: { | |
block: 'b-link', | |
url: item.url, | |
content: item.price | |
} | |
} | |
] | |
}); | |
content.push(' '); | |
}); | |
return content; | |
} | |
elem item, tag: 'li' | |
elem title, tag: 'h3' | |
elem image { | |
tag: 'img' | |
attrs: { | |
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