We're a place where coders share, stay up-to-date and grow their careers.
Methods are just static functions that run once called upon. You can pass in arguments, and they can return a value but are not required to.
Computed properties will update automatically once their dependencies change. They don't accept any arguments and must return a single value.
Watch functions allow you to monitor a single property and do stuff once it changes. They don't return any value.
That's the way I see it anyway. 🙂
Methods are just static functions that run once called upon. You can pass in arguments, and they can return a value but are not required to.
Computed properties will update automatically once their dependencies change. They don't accept any arguments and must return a single value.
Watch functions allow you to monitor a single property and do stuff once it changes. They don't return any value.
That's the way I see it anyway. 🙂