Reputation: 166
How i can bind item.image to style="background-image:url()"
<div rv-each-item="items">
<div style="background-image:url()"></div>
</div>
As shown in this RIVETS Documentation
One-way binders
rivets.binders.color = function(el, value) {
el.style.color = value
}
<button rv-color="label.color">Apply</button>
Upvotes: 0
Views: 189
Reputation: 166
I fixed this issue
<div rv-each-item="items">
<div rv-view-style="item.image"></div>
</div>
**JS**
rivets.binders['view-style'] = function(el, value) {
el.style = 'background-image:url(https://xxx/' + value + ')';
}
Upvotes: 0