2 回答
TA贡献1802条经验 获得超6个赞
用 "attr" 获取 "valuenow" 的值怎么样?
<td>
<span class="header-text">
<div class="progress-bar
progress-bar-striped active progressbartextcolor"
id="progressbarcolorchange" role="progressbar" aria-
valuenow="25" aria-valuemin="0" v-bind:style="{width:
customerLoan.progress + '%'}" aria-valuemax="100">
{{customerLoan.progress || "0"}}%</div>
</span>
</td>
<script>
$(document).ready(function () {
var bar = $('#progressbarcolorchange').attr('valuenow');
if (bar <= 50) {
$('#progressbarcolorchange').addClass("progress-bar-warning");
} else {
$('#progressbarcolorchange').addClass("progress-bar-success");
}
});
</script>
我猜“valuenow”总是在变化,对吗?
添加回答
举报