我有一个问题,你们如何从另一个 api 和循环 ex 获取 json 数据:这是我在 vue 组件上的输出
<tr>
<td>0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9</td>
<td>0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9</td>
<td>0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9</td>
<td>0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9</td>
<td>0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9</td>
<td>0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9</td>
</tr>
我想请求新的 api
http://fromanotherwebsiteap/0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9
http://fromanotherwebsiteap/0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9
http://fromanotherwebsiteap/0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9
.................
并获取 json 数据 ex: { "success": true, "client_id": "0x0cc5d2800ea2a76c8811b7d2d2091b09359378f9", "item_id": 1, "total": 658 }
this is the code inside my controller
return Scholar::latest()->paginate(10);
这是我的vue上的代码
<script>
import axios from 'axios';
import Header from './Headerscard';
import Modal from './Modal';
export default {
components: {
'Header':Header,
'Modal':Modal,
},
data() {
return{
scholars: [],
}
},
methods:{
loadScholar(){
axios.get('api/scholar').then(({ data }) =>(
this.scholars = data
));
}
},
created(){
this.loadScholar();
},
mounted(){
}
}
</script>