Promise error calling then ()

in the project of Vue

let __this = this;

let pro = function () {
    return new Promise((resolve, reject) => {
        let urlGetCarList = domain + "/app/carStatusList.action";

        __this.$http.get(urlGetCarList, {
            params: {
                "dealerId": "de590792498f11e7ae8200163e003dce",
                "beginRow": "0",
                "status": "0",
                "isShelves": "1"
            }
        }).then(response => {
            let listArr = response.body.object;
            resolve(listArr.dataList[1].oldCarId);
        });

    });
}



pro.then((id) => {
    console.log(id);
})

listArr.dataList [1] .oldCarId printing is indeed obtained, and printing Promise is also available.
could you please help me, thank you.

Mar.23,2021

pro().then((id) => {
    console.log(id);
})

pro () is returned promise,pro is a function, is a function, is a function!


maybe your this is pointing incorrectly

Menu