Vue calculation properties cannot be calculated in real time

 computed:{
            //- 2018-12-31
            aftershopticket_total:function(){

                // 

                var x;
                var t=0;
                for(x in this.shopcart_shop){
                    t+=parseFloat(this.afterdiscount_shoptotal(x));
                }

                return t.toFixed(2);

            },
        },

this.afterdiscount_shoptotal (x) data has changed, but the entire calculation property is still not re-executed
is the same in calculation properties and methods. How should it be handled to calculate in real time

Mar.24,2022

I have encountered this problem before. The reason for this problem is that vue cannot listen to dynamically adding properties to an object in Vue. For example, just like here, the shopcart_shop object starts out as an empty object ({}), and then you pass the event. this.shopcart_shop.addkey = 1 , although the object becomes {addkey: 1}, vue cannot be monitored accordingly. So there are two ways to solve it.
the first way is to add the addkey attribute to the data where you define the shopcart_shop object. For example:

this.shopcart_shop watch

watch:{
    shopcart_shop:{
        handler(newval,oldVal){
            this.afterdiscount_shoptotal
        },
        deep:true
    }
}
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-1e5dde1-67106.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-1e5dde1-67106.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?