vue 用axios 获取数据

2018-03-26  本文已影响0人  noyanse

方法一

this.$http.post('接口',{数据})
.then(res => {
})

方法二

Vue.axios.get(`/api/article/detail?id=${this.$route.params.id}`)
    .then(res => {
            this.articleDetail = res.data[0];       
     })
    .catch(err => console.log(err))
}
上一篇 下一篇

猜你喜欢

热点阅读