vue Cannot read property 'get' of undefined

除了忘记引入 vue-resource 

还可能是this的指向性发生了改变

handleDel:function(id){
    let that = this;
    parent.layer.confirm('确认删除?', {
        btn: ['确认','取消'], 
        shade: false //不显示遮罩
    }, function() {
        //确认
        that.$http.get("/position/delete/"+id).then(function(res){
            if(res.data.action){
                parent.layer.msg(res.data.msg);
                this.getList(1);
            }else{
                parent.layer.msg(res.data.msg);
            }
        })
    })
}
Logo

前往低代码交流专区

更多推荐