如上图,如何在v-for
当前行的语句取到循环到的数据?以下是现在报的错误信息:
[Vue warn]: Error compiling template:
<ul class="list-group pmd-card-list pmd-list todo-lists" id="console-service-all-list">
<li v-for="d in info" class="list-group-item timeline {{ d.t }}">
<span>{{ d.msg }}</span>
<h5 class="typo-fill-secondary">{{ d.time }}</h5>
</li>
</ul>
- class="list-group-item timeline {{ d.t }}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div class="{{ val }}">, use <div :class="val">.
(found in <Root>)
不能在属性里用插值语法了
你可以这样写:
<li v-for="d in info" class="list-group-item timeline" :class="d.t">