The problem that vue is unable to get the value

axios.get("__MODULE__/Point/getPointProduct", {
    params: {
        productno:app.pointproduct_no
    }
}).then(function (response) {

    app.thisProductNewPrice=response.data[0].NewPrice;
});
        
        
        app.pointproduct_no
        

clipboard.png

clipboard.png

but why can the following code add a timer to execute

 setInterval(function(){
                axios.get("__MODULE__/Point/getPointProduct", {
                    params: {
                        productno:app.pointproduct_no
                    }
                }).then(function (response) {

                    app.thisProductNewPrice=response.data[0].NewPrice;
                });
            },1000);
Mar.04,2021

put the axios code in the created box of app. As follows:

const app = new Vue(
    {
        data: {...},
        created() {
            // axios 
        }
    }
);

from your description, app should not be defined until after axios, or app is an asynchronously loaded object. You delayed the execution of axios through setInterval, so app came out and axios did not report wrong

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36efc-2c080.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36efc-2c080.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?