Vue Watch

up:: Vue


Use for any non-data update you want to make. Allows you to run any code in reaction to some changed data (eg. send http request).

Watchers are not used directly in template.

	watch: {
		// same name as a data or computed property
		name(value) { // whenever name changes, trigger this function
			this.fullname = value + " lastname";

With a getter function

  () => wishlistItems.value?.length,
  (length) => {
    console.log("debug", length);