【发布时间】:2020-06-06 06:52:21
【问题描述】:
我有一个柜台 1 的数据,柜台 1 有一个收银员 1 的数据,如下图:
这是我的 vue 脚本
<script>
const app = new Vue({
el:'#app',
data:{
counter1:{},
},
mounted(){
this.getQueue();
},
methods:{
getQueue(){
axios.get('api/display/showqueue')
.then((response)=>{
this.counter1=response.data
})
.catch(function (error){
console.log(error);
});
}
}
})
</script>
我希望我的收银员数据显示在此,但我什么也没得到。我认为这是因为收银员数据在 counter1 数据之下。我怎样才能提取这些数据?
<div class="col-sm-6">
<div id="app" class="card bg-gradient-lighter mt-3 shadow">
<div class="card-header-lg">
<h3 class="text-default text-uppercase">@{{counter1.department}}</h3>
</div>
<div class="card-body-sm">
<h1 class="display-1 font-weight-bold"><strong>@{{counter1.letter}}-@{{counter1.number}}</strong></h1>
</div>
<div class="card-footer-sm">
<p class="text-warning font-weight-bold">COUNTER 1</p>
</div>
</div>
</div>
【问题讨论】:
标签: javascript html laravel vue.js