嗨,我尝试用vue.js显示json文件结果,目标是将结果显示在值上。
这是我的代码:
data () {
return {
fetchData: function () {
var self = this;
self .$http.get( "/api/casetotalactivation", function( data ) {
self.items = data;
});
},
statsCards: [
{
type: 'warning',
icon: 'ti-server',
title: 'Cases',
value: this.items,
footerText: 'Updated now',
footerIcon: 'ti-reload'
}
],
Run Code Online (Sandbox Code Playgroud) 我使用这个脚本:
<div class="card-content">
<vue-tabs class="row" direction="vertical" value="Description">
<div v-for="(item, index) in siteObject.line_info" :key="index">
<v-tab :title="siteObject.line_info[index].lineid">
<div class="description text-left">
<small v-for="(field, key) in item" :key="key">
<strong>{{ key }}</strong> {{ field }}<br>
</small>
</div>
</v-tab>
</div>
</vue-tabs>
</div>
Run Code Online (Sandbox Code Playgroud)
我有这个结果:
nsn 0102799121
upk 173.0-1/1
status ACTIVE
lex_id 78EFFFEFVS
hdf_port
product_id PPS515818292
technology VDSL
access_type BBCSNaked
我怎样才能显示 wen 的状态是活跃的红色而他不活跃的灰色?