ajax 获取后台数据

  mounted(){
        this.getList();  //获取列表
    },
    methods: {
        getList() {
        this.loading = true;
        let that = this;
        axios.post('adress_____',that.form).then(function (res){
            that.loading = false;
            let data = res.data.data;
            that.tableData = data.data;
            that.form.total = data.total;
            that.form.current = data.current_page;
            that.form.pageSize = data.per_page;
        }).catch(function(error){
            that.loading = false;
            return that.add_res('505,请刷新页面再次尝试','error');//错误信息
        });
    },
  }
posted @ 2020-12-07 09:13  JaneLifeVlog  阅读(236)  评论(0)    收藏  举报