-
Notifications
You must be signed in to change notification settings - Fork 1
/
goods.bemhtml
65 lines (47 loc) · 1.31 KB
/
goods.bemhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
block goods {
tag: 'ul'
content: {
var content = [];
this.ctx.goods.forEach(function(item){
var mods = {};
if (item.new) mods.new = 'yes';
content.push({
elem: 'item',
mix: [{ block: 'box' }],
mods: mods,
content: [
{
elem: 'title',
content: item.title
},
{
elem: 'image',
url: item.image
},
{
elem: 'price',
content: {
block: 'b-link',
mix: [{ block: 'goods', elem: 'link' }],
url: item.url,
content: item.price
}
}
]
});
content.push(' ');
});
for(var i = 0; i < 10; i++) content.push({ elem: 'sizer' });
return content;
}
elem item, tag: 'li'
elem sizer, tag: 'li'
elem title, tag: 'h3'
elem image {
tag: 'img'
attrs: {
src: this.ctx.url
}
}
elem price, tag: 'span'
}