You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Returns a ref that represents the value of a prop but falls back to an internal state if the prop is not specified. This can be used to make a model prop
35
+
* optional, so that if a v-model directive is used on the component, its state is persisted in the external model, but if v-model is not used, its state
36
+
* is persisted in an internal value.
37
+
* @param fallbackValue The initial value if the prop is undefined
38
+
* @param getProp A getter for the model value prop. If it returns undefined, the prop is considered not set and the internal value is used instead.
39
+
* @param onUpdate This is called when the value is set. This should emit the update:modelValue (or similar) event.
@@ -44,6 +52,28 @@ export function useRefWithOverride<Value>(fallbackValue: Value, getProp: () => V
44
52
});
45
53
}
46
54
55
+
/**
56
+
* Returns a ref that represents the internal value of a form field whose value is only applied to a model if it passes a certain validation. An example for this would be
57
+
* a text field that is bound to a number field. The user should be able to type in the field freely, even if the value is temporarily not a valid number (such as an empty
58
+
* string or a number ending in a decimal point), but the value should only be applied to a model of type `number` when it actually is a valid number.
59
+
* options.set() is only called with validated values.
0 commit comments