The problem that the loading state of element is turned off, why this.loading = false cannot be closed

exhcangeBalance () {

        this.loading = true
        this.exchangeFrom.append("XAuthToken",3)
        this.exchangeFrom.append("voucher",this.jinEinput)
         this.$axios.post("http://localhost:8080/MeDesignMaster/account/voucherExchange",this.exchangeFrom)
        .then(response => {
            console.log(response)
            //
            this.designerAccountBalance = response.data.responseDataObject.designerAccountBalance
            this.loading = false
        })
        .catch(function(error) {
           this.loading = false
        });
    }
Jul.20,2021

html   data(){return{
    loading:''
}}

put this.loading = false on top of console


may have failed to enter the catch branch. Since the functions in catch do not use arrow functions, this this points to window

Menu