我正在为我的项目使用Bootstrap-vue表组件:
<b-table><b-table>
我希望多次使用同一个组件并显示不同的数据,因为我使用axios.get('url')
在桌面上显示API响应:
methods: {
myProvider() {
this.isBusy = true
axios.get('jsonplaceholder.typicode.com/users').then(response => {
this.items = response.data
console.log(items)
this.isBusy = false
return (items)
}).catch(e => {
this.errors.push(e)
this.isBusy = false
return {}
})
},
如何声明el并将数据传递给表,具有3种不同的API响应。
例如:
<b-table id="data1" :get="1api"></b-table>
<b-table id="data2" :get="api2"></b-table>
<b-table id="data3" :get="api3"></b-table>