步骤:
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