Vue in watch / computed using the method and its introduction scene
Others
2019-06-26 23:06:55
views: null
watch
- effect
- Defined in the data used to monitor data, when the data defined in the data changes, then watch the key will trigger
- the object is a watch
watch: {}
- You can watch a plurality of types of keys
- Use (Key)
watch: {
fn () {}
}
Computed Property
- Use
watch vs computed
- watch is used to monitor certain data, when data is changed, it will automatically trigger the watch, then we can make some tasks
- is computed in order to expose a global variable, the global variable is generated by a certain logic
- When selected watch? What is the choice computed? When selecting methods?
- Large amount of data, and we choose to watch asynchronous operation scenarios: on Raja load, pull down to refresh
- computd use two meet on it
- Exposure to a similar global variable data
- Logic may be processed
- methods of use: Event Program program (user interaction)
Origin blog.csdn.net/HelloWord182/article/details/93337036