2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
computed (computed properties) are based onWidth Height Calculate area The area will automatically resize when the width and height are changedCalculation (similar to the total price and quantity of a shopping cart, the total price changes automatically when the quantity changes)
watch The execution code width changesOver
1.computed is a calculated property.Dependency Property ValuesChanges, dataWill be morenew
watch Monitor data changes, perform the corresponding operation
2.computed If there is no change in the cache dependency, the cached data is retrieved.
watch no cache When the monitoring value changes The callback function will be executed
3. computed must be returned (the result of the calculation is aThe attribute value can beAs a parameter directly usewatch not required