Vue acquires the data in data

hotspotinformation

hotspotsmessage


the current requirement is that 16 pieces of data are randomly obtained from hotspotmessage, and then it is shown that the calculation attribute hotspots has implemented this requirement.
now I want to click on the switch and trigger the changehotspot event to replace these 16 pieces of data. What should I do? Is it using v-model?

Mar.03,2021

chagehostspot:function() {
    this.hotspotsmessage = Object.assign([], this.hotspotsmessage)
}

try


you have solved the problem by yourself


write the method not in computed, but in methods, because computed is something that needs to be updated in real time, such as entering commodity prices and calculating total prices in real time.

Menu