vue 请求多个api_vue 一个input同时请求两个接口
這個問題可以在getDate方法里在調用另外一個接口的函數。
vue里html
:value="today"
:placeholder="placeholder"
v-on:selected="getData"
>
scirpt
getStarDate(date){
console.log(date)
this.date = date.replace(/\//g, ‘‘)
api.getOrderStarsList(this.date)
.then(res => {
console.log(res.data)
if (res.data.ok) {
this.startList = res.data.r
}
}).catch(err => {
alert(err)
})
},
getData(date) {
this.date = date.replace(/\//g, ‘‘)
api.getOrderList(this.date,this.userId,this.userPhone,this.currentPage)
.then(res => {
console.log(res.data)
if (res.data.ok) {
…? ? ? ? ? ? ? ? ? ? }
}).catch(err => {
// alert(err)
})
this.getStarDate(date)
},
原文:http://www.cnblogs.com/wendy-home-5678/p/6780735.html
總結
以上是生活随笔為你收集整理的vue 请求多个api_vue 一个input同时请求两个接口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: gtp6 linux 启动_Win10更
- 下一篇: php 数组导出csv_php导出CSV