我很难实现类。
我的
<a>
有两个css类-
normal', '
下面是我的html代码。
<a href="#none" v-for="busstop in busstops"
id="busstop.id"
:class="['marker', isBusStopFail(busstop) ? 'fault': 'normal']"
onclick="detailsOpen(this);"></a>
data: {
busstops: []
....
methods: {
isBusStopFail: function(busstop) {
let failDevice = bussstop.fail;
if (failDevice.led || failDevice.usb || failDevice.bell || failDevice.gw) {
return false;
} else {
return true;
}
},
...
我的目标是将实例传递给方法。
[Vue warn]:呈现中出错:“ReferenceError:未定义bussstop”