WeChat Mini Programs has no computed but only data,. How do you solve the scenario of computed application?

problem description

WeChat Mini Programs has no computed, only data

related codes

Page({
  data: {
    text: "This is page data."
  },
  onLoad: function(options) {

  },
  onReady: function() {

  },
  ...
    //  computed 
})

scene

for example, when it comes to shopping cart settlement, the total amount needs to be calculated from time to time, and the most natural thing is to use the computed attribute, but in the absence of this attribute, how do you solve it?

Apr.07,2021

check box callback to calculate


can I use method instead

Menu