“这是我的代码,我需要循环中的多个 barrating 由 VueJS 正常运行,但未显示评级,我正在从其他文件调用 barrating,如下所示:”
$( '#example-fontawesome' ).barrating({
theme: 'fontawesome-stars',
showSelectedRating: false,
onSelect: function(){
ratingviewmodel.ratingSubmit();
}
});
$( '.examplefontawesome' ).barrating({
theme: 'fontawesome-stars',
showSelectedRating: false
});
“这里 id example-fontawesome 正在工作,但循环类 examplefontawesome 不工作”
<li class="comment thread-even depth-1" v-for="rt in ratingData">
<div class="comment-author vcard">
<b class="fn">{{ rt.display_name }}</b>
<div class="stars stars-example-fontawesome">
<select class="examplefontawesome" name="rating{{ $index }}">
<option value=""></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
<div class="br-current-rating"></div>
<div class="ctime">{{ rt.rating }}</div>
</div>
</li>