美文网首页
axios获取数据

axios获取数据

作者: Hello杨先生 | 来源:发表于2019-09-28 11:13 被阅读0次
    axios.get("https://search.damai.cn/searchajax.html", {
                            params: {
                                //数据
                                keyword: this.keywords,
                                cty: this.citylist[this.activeCityId] ? this.citylist[this.activeCityId]
                                    .name : '',
                                ctl: this.kindlist[this.activeKindId] ? this.kindlist[this.activeKindId]
                                    .name : '',
                                currPage: this.activeIndex
                            }
                        }).then((res) => {
                            console.log(res)
                            // console.log(res.data.pageData.resultData)
                            // console.log(res.data.pageData.factMap.categoryname)
                            // console.log(res.data.pageData.factMap.categoryname)
                            // console.log(res.data.pageData.factMap.cityname)
                            this.goodsList = res.data.pageData.resultData
                            this.citylist = res.data.pageData.factMap.cityname
                            // this.cityLength = res.data.pageData.factMap.cityname.length
                            this.kindlist = res.data.pageData.factMap.categoryname
                        })
    
    

    axios.get(url + {参数} ).then((res)=>{
    console.log(res)
    })

    相关文章

      网友评论

          本文标题:axios获取数据

          本文链接:https://www.haomeiwen.com/subject/vozndctx.html