vue axios请求

步骤:
1、引用
import axios from 'axios'
2、调用格式:

axios.post(url, {params})
        .then(response => {
        this.content = response.data.data;
    })
    .catch(err => {
        this.$refs.ts.showModal("失败,请检查参数!");
    });

例子参考vue菜鸟:
https://www.runoob.com/vue2/vuejs-ajax-axios.html

猜你喜欢

转载自blog.csdn.net/kairui_guxiaobai/article/details/107202665